Using Mathematica to find the approximate slope of the tangent line 
to the graph of square root at the point (4,2)

Define the function; notice the underscore in the argument of the function being defined

f[x_]=Sqrt[x]

Define the value of the argument at which we want to find the tangent line; 
notice that after putting a semicolon at the end of the line, 
Mathematica does not print the output

a = 4;

Compute the slope of the line through the points (a, f[a]) and (x, f[x]) for different values of x

x = 4.1;  (f[x]-f[a])/(x-a)

x = 4.01;  (f[x]-f[a])/(x-a)

x = 4.001;  (f[x]-f[a])/(x-a)

x = 4.0001;  (f[x]-f[a])/(x-a)

x = 4.00001;  (f[x]-f[a])/(x-a)

Of course, the above calculation uses limited accuracy, 
but in Mathematica one can compute values with greater accuracy 
by using the command N[x, n] (where x is the value, and n is the number of digits to be kept

a=4

x=a+1/10

N[(f[x]-f[a])/(x-a),50]

x=a+10^(-1);   N[(f[x]-f[a])/(x-a),50]

x=a+10^(-10);   N[(f[x]-f[a])/(x-a),50]

x=a+10^(-20);   N[(f[x]-f[a])/(x-a),50]

x=a+10^(-30);   N[(f[x]-f[a])/(x-a),50]

x=a+10^(-40);   N[(f[x]-f[a])/(x-a),50]

x=a+10^(-50);   N[(f[x]-f[a])/(x-a),50]

Here Mathematica is complaining that we want too high accuracy.  
There are ways to make Mathematica work with hundreds and thousands of digits, 
but this slows down the calculations.

Assuming that the slope of the tangent line is 0.25, which is in fact the true slope, as we showed rigorously in class, we can write the equation of the tangent line, y=f[4]+m(x-4)=2+1/4*(x-4); we plotted the graph of f[x] and its tangent line at the point (4,2)in the graph below

Plot[{f[x],2+1/4*(x-4)},{x,0,10}]