 Let's look at another example of calculating an integral that's gonna require trigonometric substitution. Let's evaluate the integral of the function one over x squared and the square root of x squared plus four with respect to x. So much like our previous examples we've seen in this lecture here, this square root of x squared plus one really indicates to us that we should be using some type of trigonometric substitution because we have a square root with the sum of different squares inside of it. Now, if we come back to our codex here that helps us translate between the algebra and the trigonometry, unlike all the previous examples where we've worked with type one here which led to a sine substitution. In this situation, we actually have a sum of squares. Remember on the previous slide here, we had the square root of x squared plus four. So we're looking for the fact that a, oops, a is two. And so we need to take the square root of four plus x squared. This tells us that we actually need to do a tangent substitution, x equals two tangent theta, like so. And this is the reason why we wanna use a tangent substitution is because we're gonna utilize the Pythagorean identity, one plus tangent squared equals secant squared. That is we can turn a sum of squares into a perfect square. Thus, when we take the square root of secant squared, we're gonna get secant. So because of this, because we have this one plus tangent squared equals a secant, what we're gonna see is that our square root of four plus x squared is gonna become a two secant theta, but I'll show you some details of that in just a moment. All right, so clearing this out so we can see things a little bit better. Like I said, we're gonna do a trig substitution. So because we have this x squared plus four inside the square root, like our codex tells us, we're gonna set x equals two tangent theta. Then taking the derivative, we're gonna end up with two secant squared theta d theta. And then the other thing you need to deal with is the square root itself. What is the square root of x squared plus four? Like I mentioned before, this is gonna be the same thing as two secant theta because tangent and secanters are just BFFs, right? They're best friends forever. So by starting with a tangent substitution, it's gonna turn the square root into a secant. You can follow that sort of just on faith, or if you wanna see a little bit more of a justification, there's certainly an algebraic way of seeing this, mostly just by plugging in for x to two tangent. If we take the square root of two tangent squared, excuse me, two tangent, we square the whole thing, add four to that. Well, then you're gonna get this factor of four is you get a two squared that's divisible with both. You get the square root of tangent squared plus one. And like we saw before, tangent squared plus one is secant squared. That becomes a two times the square root of secant squared to secant. So using the identity, we can verify this fact. That's enough evidence. Let me get rid of that. Again, the way that I seem to advertise that I like is what if we consider the right triangle because again, this I think helps us not just with the initial substitution, but it helps us translate back. If we have this right triangle, oops, this right triangle like so, then we associate it with the angle theta. Well, the original substitution here involving x and theta was this right here, solving for tangent to theta, we get tangent theta equals x over two, tangent being the opposite over adjacent ratio. We see that the opposite side is x, the adjacent side is two. And by the Pythagorean equation, we're gonna get that the hypotenuse is the square root of x squared plus four. The third side of this right triangle will always be the square root that activated the trig substitution. Now, if you're trying to solve for the square root here, what you wanna do is find a trig identity that relates together the square root and the constant side. But these triangle diagrams always have one side that's x, one side that's a constant, and then the third side will be the square root. Find the ratio that connects the constant with the square root. And there's two ratios that could be used here because this is the adjacent side and this is the hypotenuse. We could either do cosine, cosine would be two over the square root, or we could do secant, secant theta equals the hypotenuse over the adjacent side. Clearing the denominators gives us the identity that we want here. And so, again, however you prefer to do it, you need to establish the fact that the square root of x squared plus four is equal to two secant theta. That's gonna be useful in this substitution. So now let's go about and translate the integral into from x variable to theta here. So the one, we don't have to do anything with it, but the dx, like we saw before, will become a two secant squared theta d theta. The x squared on the bottom will replace the x with a two tangent, but do remember to square that. And then the square root on the bottom becomes a two secant, which we have right there. And so then once we've switched everything from x to theta, simplify things as appropriately, right? So there's a two on top, we can cancel that too. There's a secant on bottom, that cancels up one of the secants on the top. The two on the bottom here, you'll square it to get a four, that's a constant multiple factor out. We get a 1 fourth, the integral of secant theta d theta all over tangent squared. And so that's fairly simple, but we have to remember our goal is to integrate that thing. Is this in a format that's really inclined for integration? If we had like a secant squared on top, that would be wonderful because you could do a u substitution where u equals tangent theta. But the problem is we don't have a secant squared on top anymore, we have only a secant. Introducing a secant in the bottom, it doesn't really help us out too much. So in this situation, I think it probably is to our advantage to switch things to signs and cosines. If you're not sure what to do with secant and tangent, you can always switch it over to be signs and cosines. It can be more messy that way, but sometimes if you just get stuck, it's better to do something to nothing. The secant on top becomes a one over cosine theta. The tangent on the bottom, well since tangent sine over cosine we're taking the reciprocal, we're gonna get cosine squared on top, sine squared on bottom. And so in this situation, if we try to simplify some cosines here, you're gonna get a cosine on top, a sine squared on bottom. Now this one's very much in line for a u substitution. Let me write the simplified form here. We have one fourth the integral of cosine theta d theta over sine squared theta. So now in this situation, if we do a u substitution where u is sine and then du would be cosine theta d theta, you see exactly that this thing looks to be of the form one fourth, the integral of du over u squared are if you prefer, we'll do u to the negative two d theta. That's a nice power function expression. Finding the antiderivative that should be fairly much a cinch. We're gonna get one fourth, u raised the power to negative power so it can be raised to negative one and then you divide by negative one at a constant. That's of course the same thing that it's just negative one over four u plus your constant. And so now we have the variable u, remember where we are on our journey, right? The original functions in terms of x, we need to get back to x. So let's switch from u to theta. That should be fairly painless given the u substitution is still here on our screen. We're gonna end up with negative one, one over four sine theta plus our constant. If you don't like the sine of the denominator, we could always write this as a cosecant or we're gonna switch this back to x either way. So it doesn't make much of a difference, whichever you prefer. Now, and help us to translate sine back. It might be useful to come look at this original triangle. Now remember, we're trying to do sine. Sine is opposite over hypotenuse. So connecting those together would do sine x over the square root of x square plus four or if you prefer to do cosecant, it would be the square root of x square plus four over x. Again, it doesn't really matter too much as long as you're consistent, make a choice and do one or the other. So we'll stick with sine here. So with the sine substitution, we get negative one over four times x over that square root square root of x square plus four. Now I'm not a big fan of having fractions inside of fractions. So if we reciprocate this, we end up with negative the square root of x square plus four over four x plus a constant. And this then gives us the anti-derivative we were looking for. So a trig substitution involving the tangent substitution as opposed to sine. It works very similar. It's really, it's just use your triangle diagram to help you work through it. You have to translate from x to the theta. You integrate the trigonometric integral and then you have to translate the theta back to x. And in order to calculate the trigonometric integral, you might have to do techniques like u substitution like we saw in this example or integration by parts or some trigonometric identities, whichever you need to do.