finding an equation of the tangent line to a curve at the given point in MATLAB

136 次查看(过去 30 天)
I tried looking for and solving this for an hour and I am stumped.
the question I am trying to have answered is: find an equation of the tangent line to the curve at the given point y=4x-3x^2, (2,-4)

回答(2 个)

Birdman
Birdman 2021-1-27
Actually, it is quite simple to do. For instance, let's define the equation symbolically in MATLAB:
syms y(x)
y(x)=4*x-3*x^2;
Then, take the derivative:
dy(x)=diff(y,x)
which would be
4-6*x
At this point, you can find the slope of the tangent line at point (2,-4) by inserting 2 into the above equation, which would be
4-6*(2)=-8
You know that the slope of tangent line is -8, but you should also find the value of y for that tangent line. Consider it as
y=-8*x+c
Then find the c by simply
-4=-8*(2)+c
where c would be 12.
If you plot both curves in the same figure, you will get
where the blue line is the original equation and red line is tangent line.

KAMEWSARA
KAMEWSARA 2022-12-27
y=x.^2

类别

Help CenterFile Exchange 中查找有关 Calculus 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by