Thursday, 23 February 2017

LaTeX and Integrating Square Root of Tangent Function

The following integration follows the steps outlined in this YouTube video that I watched, so I'm not claiming any originality here. However, I wanted to practise my LaTeX skills and so, using MacTex, a LaTeX implementation for OS X, and TeXShop, the front-end text editor, I translated the steps outlined in the video into LaTeX. MacTex produced a crisp PDF output file but later I wondered what would happen if I copied the code and pasted it into this blog. Well, turns out it rendered almost perfectly. The result is shown below:

**********************************************

How can we deal with  tanxdx? If the square root sign wasn't there it would be easy and we'd get  log(cosx)+C. However, it is there and we need to find a way to deal with it. Well, it turns out that there is a judicious substitution that we can use to get the process started and that substitution is u=tanx.

This means that u2=tanx and so 2udu/dx=sec2x. dxcan now be written as 2udu/sec2x and thus the integral becomes 2u2du/sec2xand the problem now is to express sec2x in terms of u. Fortunately that's not too difficult with recourse to a little trigonometry. We know tanx=u2 and if we write this as tanx=u2/1 (opposite over adjacent) then the hypotenuse of the associated right-angled triangle is 1+u4.

Thus cosx=1/1+u4, sec2x=1+u4 and the integral becomes: 2u21+u4duThere is still a way to go before we arrive at the solution to our problem but this is a far more manageable integral than the one that we started with. Now we need to spend some time manipulating the integral to get it into the right form. Firstly, let's divide top and bottom by u2. This gives us: 2u2+1/u2duThe next step is to us modify the numerator 2 so that it looks like this:1+1/u2+11/u2Now we separate the integral into two halves as follows:1+1/u2u2+1/u2du+11/u2u2+1/u2duThe denominators in both integrals can be rewritten as shown:1+1/u2(u1/u)2+2du+11/u2(u+1/u)22duEach integral needs to be dealt with separately so let's begin with the integral on the left hand side. However, we need to make another substitution before we proceed. Let t=u1/u. Differentiating both sides w.r.t. u, gives dt/du=1+1/u2 and so the integral on the left hand side can be rewritten:1+1/u2(u1/u)2+2du=1t2+2dtAn integral of the form 1t2+a2dt=1atan1(ta)+Cand so we end up with 12tan1(t2)+CNow we need to backtrack, replacing t by u and u by tanx. This will give us firstly 12tan1(u1/u2)+CAnd then 12tan1(tanx1/tanx2)+CBut this is only the left hand side of our integral! Now we need to go back and deal with the right hand side integral which was:11/u2(u+1/u)22duThis time let t=u+1/u. Differentiating both sides w.r.t. u, gives dt/du=11/u2 and so the integral on the left hand side can be rewritten:11/u2(u+1/u)22du=1t22dtThis integral can be solved by rewriting t22 as (t2)(t+2) and then using the method of partial fractions to find A and B in the expression:At2+Bt+2This leads to (A+B)t+(AB)2=1, A=B, 2A2=1 and A=1/22
Hence B=1/22 and the integral can be now be rewritten as:1/22t2dt1/22t+2dtBoth these integrals are natural logarithms and so the result obtained is:
122(ln(t2)ln(t+2))+CThis simplifies to:122ln(t2t+2)+CNow we need to backtrack, replacing t by u and u by tanx. This will give us firstly122ln((u+1/u)2(u+1/u)+2)+CAnd then 122ln((tanx+1/tanx)2(tanx+1/tanx)+2)+CPutting both integrals together now we get the result that:tanxdx=12tan1(tanx1/tanx2)+122ln((tanx+1/tanx)2(tanx+1/tanx)+2)+C
It was an arduous process but in the end our goal was accomplished.

No comments:

Post a Comment