Integration by substitution

Skelly4444

Junior Member
Joined
Apr 4, 2019
Messages
63
I am struggling to integrate (1+sinx) / cosx
using the substitution of u=sinx

The answer in the back of the book is -ln(1-sinx) + C
but whenever I type it into an online calculator, it comes up with a different answer?

Any guidance on how they've arrived at this answer would be greatly appreciated.
 
If u=sin x then du = cos x dx. But this doesn't really help to simplify \(\displaystyle \int \frac{1 + sin x}{cos x} dx\), because there is no \(\displaystyle cos x dx\) part.

You need to do some algebraic manipulation first.
Multiply top and bottom of the expression to integrate by (1 - sin x), simplify and then do the integration by substitution.
Give it a go and then come back and show us or ask for more help.

By the way, what does the online calculator give as the answer?
 
If u=sin x then du = cos x dx. But this doesn't really help to simplify \(\displaystyle \int \frac{1 + sin x}{cos x} dx\), because there is no \(\displaystyle cos x dx\) part.

You need to do some algebraic manipulation first.
Multiply top and bottom of the expression to integrate by (1 - sin x), simplify and then do the integration by substitution.
Give it a go and then come back and show us or ask for more help.

By the way, what does the online calculator give as the answer?
Many thanks for that, the online calculator splits the fraction into secx and tanx and solves them separately to give
ln(tanx + secx) - ln(cosx) + C

I found another online calculator that replaces dx with du/cosx which gives cos^2x on the bottom. This can then be replaced with 1-sin^2x and then the whole fraction just contains sin.

Thanks for your help.
 
Many thanks for that, the online calculator splits the fraction into secx and tanx and solves them separately to give
ln(tanx + secx) - ln(cosx) + C
[imath]\displaystyle\int {\frac{{1 + \sin (x)}}{{\cos (x)}}} dx=\displaystyle\int {{\tan(x) + \sec (x)}} dx[/imath]
Because [imath]\displaystyle{\frac{\sin(x)}{\cos(x)}=\tan(x)~\&~\frac{1}{\cos(x)}=\sec(x)}[/imath]
 
The answer in the back of the book is -ln(1-sinx) + C
but whenever I type it into an online calculator, it comes up with a different answer?
Many thanks for that, the online calculator splits the fraction into secx and tanx and solves them separately to give
ln(tanx + secx) - ln(cosx) + C

-ln( 1-sin(x) )
= ln( 1/(1-sin(x)) )
= ln( (sin(x)+1) / [ (1-sin(x))(1+sin(x)) ] )
= ln( (sin(x)+1) / (1-sin(x)^2) )
= ln( (sin(x)+1)/cos(x)^2 )
= ln( (tan(x)+sec(x)) / cos(x) )
= ln(tan(x) + sec(x)) - ln(cos(x))

Therefore both answers are the same, EXCEPT that the very bottom line "ln(tan(x) + sec(x)) - ln(cos(x))" is only valid where cos(x)>0, therefore the answer at the back of the book is better because it's valid over a greater domain.
 
I am struggling to integrate (1+sinx) / cosx

The answer in the back of the book is -ln(1-sinx) + C

The book's answer needs absolute value bars around the argument. A variation of the answer that
you gave in post #3 from an online calculator keeps everything in terms of tangents and secants:

\(\displaystyle ln|tan(x) + sec(x)| \ + \ ln|sec(x)| + C \)
 
Can this expression be solved by using the substitution u=cosx instead of u=sinx?

I have tried using cosx but can't seem to get anywhere with it.
 
Not quite sure what you mean here, I just wanted to know whether u=cosx would produce anything useful to successfully integrate the expression?
 
The way u-substitution works is you choose something to be u and what is left over should be within a constant multiple of du.

You probably can make the substitution u=cosx but then you need to write (1+sinx) in terms of u and dx = -du/sinx in terms of u

It will be very messy and that is not what u-subs are all about.
 
Top