# Trig Sub, Need check

1. Oct 6, 2008

### Sheneron

1. The problem statement, all variables and given/known data
$$\int \frac{\sqrt{9-x^2}}{x} dx$$

So:
$$x = 3Sin(\Theta)$$
$$dx = 3Cos(\Theta)d\Theta$$

Rewritten:
$$\int \frac{\sqrt{9 - (3Sin(\Theta))^2}*3Cos(\Theta)d\Theta}{3Sin(\Theta)}$$

$$\int \frac{\sqrt{9(1-Sin(\Theta)^2)}*3Cos(\Theta)d\Theta}{3Sin(\Theta)}$$

$$\int \frac{3Cos(\Theta)^2}{Sin(\Theta)}$$

When I check this with mathematica (replacing sin and cos with something in terms of x) it doesn't match. Its a different answer.

2. Oct 6, 2008

### Sheneron

Nevermind, I will fix that latex in a few minutes, physics forums is not working well.

3. Oct 6, 2008

### Sheneron

Ok there we go... Yes, when I integrate the initial equation in mathematica I get an answer that does not equal when I integrate at the last step I have done. And I rewrite it back in terms of x dx so that is not it. Did I do something wrong?

4. Oct 6, 2008

### Redbelly98

Staff Emeritus
Your derivation looks right to me.

5. Oct 6, 2008

### Sheneron

Hmm, according to mathematica I am off exactly by a factor of 3?

6. Oct 6, 2008

### Dick

Can you say what you got and what mathematica got?

7. Oct 6, 2008

### Sheneron

Integrating at the very beginning equation mathematica gave me:

$$\sqrt{9 - x^2} + 3\ln{x} - 3 \ln{3 + \sqrt{9 - x^2}}$$

and when I integrate my step I get:

$$3*( \sqrt{9 - x^2} + 3\ln{x} - 3 \ln{3 + \sqrt{9 - x^2}} )$$

8. Oct 6, 2008

### Sheneron

I am also stuck at my last step, what would be a good way of integrating that?

-but I don't know if thats right seeing how my answer doesn't match with mathematica.

9. Oct 6, 2008

### Redbelly98

Staff Emeritus
How about an approximate numerical check, which will tell you who's off by a factor of 3?

Your integrand varies wildly near x=0 and x=3, so stay away from those values. Try approximating the integral (over x) from 0.99 to 1.01, just treating the integrand as a constant evaluated at x=1. What does that give for the integral? Compare it to your final answer, and to the mathematica answer.

10. Oct 6, 2008

### Sheneron

Oh crap Im sorry, I plugged it in wrong. The answer is still different though and still wrong.

Here is what mathematica gave me:

$$-\frac{x^2}{2} + 9\ln{x}$$

11. Oct 6, 2008

### Sheneron

I just tried that... plugged in 0.99 and 1.01 as my limits and got 0.0565705 from the mathematica answer and 0.160006 from the step I got to

12. Oct 6, 2008

### Dick

Your first step should be to differentiate those and see if you get sqrt(9-x^2)/x. I don't think you will, neither one looks right. Did you leave out some parentheses or something?

13. Oct 6, 2008

### Sheneron

Sorry, but that second equation changed as I realized I plugged in the wrong stuff. Still though they are different and unequal. I don't know why mathematica would be wrong and I can't figure out where I am either.

14. Oct 6, 2008

### Dick

What ARE you doing? Are you trying to turn cos(theta)^2*dtheta/sin(theta) BACK into x before you integrate? Don't do that! If you do it right, you'll just get back where you started. Integrate dtheta, THEN turn back into x.

15. Oct 6, 2008

### Sheneron

oh crap... no wonder

thanks. I will go work on it

16. Oct 6, 2008

### Dick

Whew. Thought I was going crazy. I'll give you a free hint. cos(theta)^2=1-sin(theta)^2.

17. Oct 6, 2008

### Redbelly98

Staff Emeritus
Okay. And what about the approximate answer using the original integral? I.e., what is

$$\int \frac{\sqrt{9-1^2}}{1} dx$$
evaluated from 0.99 to 1.01?

18. Oct 6, 2008

### Dick

I think we've sorted it out. Somebody (and I won't name names) is new to trig substitutions. Or has forgotten.

19. Oct 6, 2008

### Sheneron

But how would you integrate the last step on my first post?

20. Oct 6, 2008

### Dick

Use cos(theta)^2=1-sin(theta)^2. I think I already suggested that. Though I think I edited it in.