Hi this is my first time on this site. Im looking for some suggestions on plotting tangent line equation on a given point. This is my first Calculus project and I am not familiar with Mathematica. Hopefully I you can help me out (: I am really sorry if this formatting is bad, I am still getting use to the tools available here. My equation is:
f(x): = 4 sqrt(x) - 3^(x), x = 2
And, this is my code so far: This is to find the 1st Derivative.
d1F[x_] = f'[x]
This code block is to find the tangent line equation
Collect[Normal[Series[f[x], {x, a, 1}]], x, Simplify]
This code is for plotting f[x] and f'[x], but how can I plot the tangent line equation on a given point in the same axes as f[x] and f'[x] ?
Plot[{f[x],d1F[x]},{x,-10,10}, PlotLegends -> "Expressions"]
I also tried this code but the graph comes out blank or gives me error when I run it.
tangentF[x_, x0_] = f[x0] + f'[x0] (x - x0) // Simplify
With[{x0 = 2},
Plot[{f[x], d1F[x], tangentF[x, x0]}, {x, -2, 1},
Epilog -> {Red, PointSize[Large], Point[{x0, f[x0]}]},
AspectRatio -> 1,
PlotRange -> {-4, 4},
PlotLegends -> {"Function", "Derivative", "Tangent Line"}]]