What is the equation of the tangent line of #f(x)=e^(-x^2)sinx-e^xcos(-x)# at #x=pi/4#?

1 Answer
Mar 13, 2016

#y=-0.2187x-1#

Explanation:

Finding tangent line equations come in 3 steps: Taking the derivative, evaluating it at some #x#-value, and then using that information to find the actual equation.

Before we begin, note that because #cosx# is an even function, #cos(-x)=cosx#. We can therefore rewrite #f(x)=e^(-x^2)sinx-e^xcos(-x)# as #f(x)=e^(-x^2)sinx-e^xcosx#, getting rid of that negative sign in #cos(-x)#.

Step 1: Find the Derivative
This will be the most challenging step as we will have to apply the sum rule, product rule and chain rule to find the derivative. The sum rule allows us to break it up into two separate pieces - #e^(-x^2)sinx# and #e^xcosx#.

Step 1A: Derivative of #e^(-x^2)sinx#
We will have to use the product rule here, which states:
#d/dx(uv)=u'v+uv'-># where #u# and #v# are functions of #x#
In our case, #u=e^(-x^2)# and #v=sinx#. The derivative is:
#(e^(-x^2))'(sinx)+(e^(-x^2))(sinx)'#
#=-2xe^(-x^2)(sinx)+e^(-x^2)(cosx)#
#=e^(-x^2)(-2xsinx+cosx)#

Step 1B: Derivative of #e^xcosx#
Again, we have to apply the product rule, this time with #u=e^x# and #v=cosx#:
#(e^x)'(cosx)+(e^x)(cosx)'#
#=e^xcosx-e^xsinx#
#=e^x(cosx-sinx)#

The entire derivative is therefore #f'(x)=e^(-x^2)(-2xsinx+cosx)-e^x(cosx-sinx)#

Step 2: Evaluate to Find Slope
We are being asked to find the tangent line at #pi/4#; to do so, we evaluate the derivative at #pi/4# to find the slope:
#f'(pi/4)=e^(-(pi/4)^2)(-2(pi/4)sin(pi/4)+cos(pi/4))-e^(pi/4)(cos(pi/4)-sin(pi/4))#
#f'(pi/4)=e^(-pi^2/16)((-pi/2)(sqrt(2)/2)+sqrt(2)/2)-e^(pi/4)(0)#
#f'(pi/4)=e^(-pi^2/16)((sqrt(2)/2)(-pi/2+1)#
#f'(pi/4)=e^(-pi^2/16)((sqrt(2)/2)((2-pi)/2))#
#f'(pi/4)=e^(-pi^2/16)((2sqrt(2)-pisqrt(2))/4)#
#f'(pi/4)=e^(-pi^2/16)((2sqrt(2)-pisqrt(2))/4)#
#f'(pi/4)~~-0.2178#

This is the slope of the tangent line at #pi/4#.

Step 3: Equation of Tangent Line
Tangent lines are of the form #y=mx+b#, where #x# and #y# are points on the line, #m# is slope, and #b# is #y#-intercept. We know the slope, #m#, and we can get #x# and #y# by evaluating #f(pi/4)#:
#f(pi/4)=e^(-(pi/4)^2)sin(pi/4)-e^(pi/4)cos(pi/4)#
#f(pi/4)=e^-(pi^2/16)sqrt(2)/2-e^(pi/4)sqrt(2)/2#
#f(pi/4)=sqrt(2)/2(e^(-(pi^2/16))-e^(pi/4))~~-1.1693#
Our point is #(pi/4, -1.1693)#.

We will now use this information to find the equation. All we need to do now is solve for #b#, the #y#-intercept, using #x#, #y#, and #m#:
#-1.1693=(pi/4)(-0.2178)+b#
#-1.1693=-0.171+b#
#-1~~b#

The equation of the tangent line is thus #y=-0.2178x-1# (note that this is just an approximation).