What is #f(x) = int e^xcosx-tan^3x+sinx dx# if #f(pi/6) = 1 #?

1 Answer
Feb 13, 2018

#e^x/2(sin(x)+cos(x))-ln|cos(x)|-1/2sec^2(x)-cos(x)+5/3+sqrt3/2-(1/4+sqrt3/4)e^(pi/6)+ln(sqrt3/2)#

Explanation:

We begin by splitting the integral into three:
#int\ e^xcos(x)\ dx-int\ tan^3(x)\ dx+int\ sin(x)\ dx=#

#=int\ e^xcos(x)\ dx-int\ tan^3(x)\ dx-cos(x)#

I will call the left integral Integral 1 and the right one Integral 2

Integral 1
Here we need integration by parts and a little trick. The formula for integration by parts is:
#int\ f(x)g'(x)\ dx=f(x)g(x)-int\ f'(x)g(x)\ dx#

In this case, I'll let #f(x)=e^x# and #g'(x)=cos(x)#. We get that
#f'(x)=e^x# and #g(x)=sin(x)#.

This makes our integral:
#int\ e^xcos(x)\ dx=e^xsin(x)-int\ e^xsin(x)\ dx#

Now we can apply integration by parts again, but this time with #g'(x)=sin(x)#:
#int\ e^xcos(x)\ dx=e^xsin(x)-(-e^xcos(x)-(-int\ e^xcos(x)\ dx))#

#int\ e^xcos(x)\ dx=e^xsin(x)+e^xcos(x)-int\ e^xcos(x)\ dx#

Now we can add the integral to both sides, giving:
#2int\ e^xcos(x)\ dx=e^xsin(x)+e^xcos(x)#

#int\ e^xcos(x)\ dx=1/2(e^xsin(x)+e^xcos(x))+C=#

#=e^x/2(sin(x)+cos(x))+C#

Integral 2
We can first use the identity:
#tan(theta)=sin(theta)/cos(theta)#

This gives:
#int\ tan^3(x)\ dx=int\ sin^3(x)/cos^3(x)\ dx=int\ (sin(x)sin^2(x))/cos^3(x)\ dx#

Now we can use the pythagorean identity:
#sin^2(theta)=1-cos^2(theta)#

#int\ (sin(x)(1-cos^2(x)))/cos^3(x)\ dx#

Now we can introduce a u-substitution with #u=cos(x)#. We then divide by the derivative, #-sin(x)# to integrate with respect to #u#:
#-int\ (cancel(sin(x))(1-cos^2(x)))/(cancel(sin(x))cos^3(x))\ du=-int\ (1-u^2)/u^3\ du=int\ u^2/u^3-1/u^3\ du=#

#=int\ 1/u-1/u^3\ du=ln|u|+1/(2u^2)+C=ln|cos(x)|+1/(2cos^2(x))+C#

Completing the original integral
Now that we know Integral 1 and Integral 2, we can plug them back into the original integral and simplify to get the final answer:
#e^x/2(sin(x)+cos(x))-ln|cos(x)|-1/2sec^2(x)-cos(x)+C#

Now that we know the antiderivative, we can solve for the constant:
#f(pi/6)=1#

#e^(pi/6)/2(sin(pi/6)+cos(pi/6))-ln|cos(pi/6)|-1/2sec^2(pi/6)-cos(pi/6)+C=1#

#-2/3-sqrt(3)/2+1/2(1/2+sqrt(3)/2)e^(pi/6)-ln(sqrt(3)/2)+C=1#

#C=1+2/3+sqrt3/2-(1/4+sqrt3/4)e^(pi/6)+ln(sqrt3/2)#

#C=5/3+sqrt3/2-(1/4+sqrt3/4)e^(pi/6)+ln(sqrt3/2)#

This gives that our function is:
#e^x/2(sin(x)+cos(x))-ln|cos(x)|-1/2sec^2(x)-cos(x)+5/3+sqrt3/2-(1/4+sqrt3/4)e^(pi/6)+ln(sqrt3/2)#