# Computation of integrals.

1. Nov 13, 2006

### MathematicalPhysicist

i need to solve/prove the next two integrals:
$$\int\frac{dx}{u^2+u+4}$$
and i need to show that:
$$\int_{0}^{\pi}\sqrt{1+sinx}dx=4$$
the problem is that i have a clue to substitute u=sinx and then sin(pi)=0=sin0 so the integral should be equal zero, is it not?
ofcourse the integrand becomes: sqrt(1+u)/sqrt(1-u^2)

2. Nov 13, 2006

### neutrino

For the first you can use the method of partial fractions.

You're right about the second. With the given limits, the integral is equal to zero.

3. Nov 13, 2006

### Max Eilerson

substitute u = 1 + sin x. Are you sure the integral is equal to 4, not -4?

4. Nov 13, 2006

### neutrino

But the plot (area) of the function sqrt(1+sin(x)) from 0 to pi seems to be non-zero!

5. Nov 13, 2006

### Max Eilerson

It's non-zero.

6. Nov 13, 2006

### MathematicalPhysicist

neutrino, how would i use partail fractions here?
i mean i need to decompose u^2+u+4 into a product of terms, but i have complex roots here.

7. Nov 13, 2006

### Max Eilerson

complete the square.

8. Nov 13, 2006

### MathematicalPhysicist

you mean something like this: u^2+u+4=(u-2)^2+5u
i still dont get an appropiate term to integrate.

9. Nov 13, 2006

### neutrino

More like (u +0.5)^2 + 15/4

10. Nov 13, 2006

### MathematicalPhysicist

ok, thanks.
btw, what about the second integral does it equal zero or it really does equal 4?

11. Nov 13, 2006

### Max Eilerson

u^2+u+4= (u + 0.5)^2 + 15/4.

edit: too slow, the second integral should equal minus -4, I guess they're defining is it as area so you just need the modulus.

12. Nov 13, 2006

### neutrino

Not -4. I just put the function through the Integrator and substituted the values, and I got 4. This graph is completely above the x-axis.

13. Nov 13, 2006

### Max Eilerson

Btw, you will need to know what the derivative of the inverse tangent is.

14. Nov 13, 2006

### Max Eilerson

Oops, I'm missing/added a minus somewhere. Didn't have the common senese to think about the graph :).

15. Nov 15, 2006

### MathematicalPhysicist

wait a minute, then integral does converge to 4, care to explain how, where did i get it wrong?

16. Nov 15, 2006

### dextercioby

For the integral try the sub

$$\tan\frac{x}{2}=t$$

Daniel.

17. Nov 15, 2006

### MathematicalPhysicist

but what's wrong with the substitution that im given a hint to use here?
i.e
sinx=u?

18. Nov 15, 2006

### HallsofIvy

If you let u= sin(x) then du= cos(x)dx so your integral will involve something like $\frac{du}{cos(x)}$ (with the cos(x) converted to u of course) but $cos(\pi/2)= 0$ so that is not a valid substitution.

19. Nov 15, 2006

### NateTG

You need to be careful about which square root you're using: The integrand should be:
$$\frac{\sqrt{1+u}}{\pm \sqrt{1-u^2}}$$
The trick is that you'll be using one square root from $x=0$ to $x=\frac{\pi}{2}$ and the other root from $x=\frac{\pi}{2}$ to $x=0$.

Last edited: Nov 15, 2006
20. Nov 15, 2006

### MathematicalPhysicist

ok, i understand the trick here, i havent seen this point x=pi/2 as a "bad" point, thank you for the pointers.