What is f(x) = int xsinx + secxtan^2x -cosx dx if f(pi)=-2 ?

1 Answer
Mar 29, 2017

f(x)=1/2secxtanx-1/2lnabs(secx+tanx)-xcosx-pi-2

Explanation:

Splitting this into three pieces:

I=intxsinxdx

Use integration by parts. Let:

{(u=x,=>,du=dx),(dv=sinxdx,=>,v=-cosx):}

Then:

I=-xcosx+intcosxdx=-xcosx+sinx+C

The next part:

J=intsecxtan^2x

Use tan^2x=sec^2x-1:

J=intsec^3xdx-intsecxdx

The second integral is known. For sec^3x, perform integration by parts again, this time letting:

{(u=secx,=>,du=secxtanx),(dv=sec^2xdx,=>,v=tanx):}

So:

J=(secxtanx-intsecxtan^2x)-lnabs(secx+tanx)

Note that the original integral J has reappeared on the right-hand side. Add it to both sides of the equation:

2J=secxtanx-lnabs(secx+tanx)

J=1/2secxtanx-1/2lnabs(secx+tanx)+C

Finally, we see that the last piece is:

K=intcosxdx=sinx+C

Our whole integral is:

f(x)=I+J-K

f(x)=-xcosx+sinx+1/2secxtanx-1/2lnabs(secx+tanx)-sinx+C

Simplified:

f(x)=1/2secxtanx-1/2lnabs(secx+tanx)-xcosx+C

Now solving for C using the initial condition f(pi)=-2:

-2=1/2secpitanpi-1/2lnabs(secpi+tanpi)-picospi+C

-2=1/2(-1)(0)-1/2lnabs(-1+0)-pi(-1)+C

-2=-1/2ln(1)+pi+C

Since ln(1)=0:

C=-2-pi

Then:

f(x)=1/2secxtanx-1/2lnabs(secx+tanx)-xcosx-pi-2