210 CHAPTER 8. METHODS FOR FINDING ANTIDERIVATIVES

therefore, in terms of u, the antiderivative equals −u+2arctanu. Now replace u to obtain

− tan(

θ

2

)+2arctan

(tan(

θ

2

))+C.

This procedure can be expected to work in general. Suppose you want to find∫ p(cosθ ,sinθ)

q(cosθ ,sinθ)dθ

where p and q are polynomials in each argument. Make the substitution u = tan θ

2 . Asabove this means

du =

(1+ tan2

2

))12

dθ =12(1+u2)dθ .

It remains to substitute for sinθ and cosθ . Recall that sin(

θ

2

)=±

√1−cosθ

2 and cos(

θ

2

)=

±√

1+cosθ

2 . Thus,

tan(

θ

2

)=

±√

1− cosθ√1+ cosθ

and so

u2 = tan2(

θ

2

)=

1− cosθ

1+ cosθ

and solving this for cosθ and sinθ yields

cosθ =1−u2

1+u2 , sinθ =± 2u1+u2 .

It follows that in terms of u the integral becomes

∫ p(

1−u2

1+u2 ,± 2u1+u2

)q(

1−u2

1+u2 ,± 2u1+u2

) 2du1+u2

which is a rational function of u and so in theory, you might be able to find the integralfrom the method of partial fractions. As usual, there are no magic bullets. Even the besttechniques can fail if for no other reason than our inability to factor polynomials. In calcu-lus, there are big theorems like the fundamental theorem of calculus which have universalapplication and then there are many gimicks which sometimes work. This chapter has beendevoted to these gimmicks.

8.9 Using MATLABYou can use computer algebra systems to find antiderivatives and save a lot of pain. I willexplain for MATLAB and note that you can do it for any of the standard computer algebrasystems. Say you want to find the obnoxious antiderivatives∫ √

1+3x2dx

210 CHAPTER 8. METHODS FOR FINDING ANTIDERIVATIVEStherefore, in terms of u, the antiderivative equals —u + 2 arctanu. Now replace u to obtain(7) (e)—tan (5) +2arctan («an (5)) +C.This procedure can be expected to work in general. Suppose you want to findp(cos 6,sin@)P (cos, sin) 4q(cos 0, sin@)where p and q are polynomials in each argument. Make the substitution u = tan $. ASabove this means(e)du = (1 +tan? (5))4 310 =5 ‘a +u’) d@.It remains to substitute for sin @ and cos @. Recall that sin (3) =+,/ 1-g0s8 and cos (3) =+,/1*5°88 | Thus,tan (5) _ +v1—cosé2 V1 +cos@and so= tan? (5) _ 1~cos@2 1+cos@and solving this for cos @ and sin @ yields2cos 8 = = sin@ =+ i —It follows that in terms of u the integral becomes1-2 2upolite) 2dul=u2 , Qu) 1+u2g (55+)which is a rational function of u and so in theory, you might be able to find the integralfrom the method of partial fractions. As usual, there are no magic bullets. Even the besttechniques can fail if for no other reason than our inability to factor polynomials. In calcu-lus, there are big theorems like the fundamental theorem of calculus which have universalapplication and then there are many gimicks which sometimes work. This chapter has beendevoted to these gimmicks.8.9 Using MATLABYou can use computer algebra systems to find antiderivatives and save a lot of pain. I willexplain for MATLAB and note that you can do it for any of the standard computer algebrasystems. Say you want to find the obnoxious antiderivatives/ V143x2dx