# Manipulate and Graphing Multiple Functions on the same Axis [duplicate]

Can Anyone help me out graph both function and its tangent line on the same xy axes, please?

f[x_] := a*x^3 + b*x^2 +c*x;
tanLine[g_, x0_] := (D[g[x],x]/. x-> x0)*(x-x0)+g[x0];
Manipulate[Plot[{a*x^3 + b*x^2 +c*x,tanLine[f[x],1]},
{x, 0,5}, PlotStyle -> {Red, Blue}],{{a,-1},-2,3,Appearance -> "Labeled"},{{b,3},-5,5,Appearance -> "Labeled"},{{c,0},-10,20,Appearance -> "Labeled"}]


Any help would be appreciated. CS

## marked as duplicate by m_goldberg plotting StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Feb 21 at 22:34

• There are mainly scoping issues. Try tanLine[x_, {x0_, a_, b_, c_}] = (D[f[x], x] /. x -> x0)*(x - x0) + f[x0]; and Manipulate[Plot[{a*x^3 + b*x^2 + c*x, tanLine[x, {1, a, b, c}]} ...  – march Feb 21 at 21:12