# Oopsie, issue with change of variables to evaluate definite integral

1. Mar 12, 2009

### BobbyBear

I needed to evaluate the following integral (for constructing Chebyshev polynomials by an orthogonalisation process), but I just discovered that I'm having an issue with the change of variable technique:P The specific integral itself is unimportant as to the issue I'm having, but by means of an example this is the one I was solving when it arose:

$$\int_{-1}^{1} \frac{1}{\sqrt{1 - x^2}} dx$$

And I believe this is done with the following change of variable:

$$x = g(\theta) = cos (\theta); \ \ \rightarrow \ \ dx= g'(\theta) = -sin(\theta)d\theta$$

But since the transformation has to be bijective (or however you say:P), one would have to limit the range of $$\theta$$ otherwise the inverse relationship $$\theta = g^{-1}(x)$$ would not be a single valued function.

So for example, I can restrict $$\theta$$ as so: $$0 \leq\theta \leq \pi$$
in which case $$g^{-1}(x=-1)=\pi ; \ \ \ g^{-1}(x=1)=0$$
and thus:
$$\int_{-1}^{1} \frac{1}{\sqrt{1 - x^2}} dx = \int_{\pi}^{0} \frac{-sin(\theta)}{\sqrt{(sin(\theta)^2}} d\theta = \int_{\pi}^{0} -d\theta = \int_{0}^{\pi} d\theta = \pi$$

BUT! if for example I use the same transformation but restricting $$\theta$$ to: $$\pi \leq\theta \leq 2\pi$$
then I have: $$g^{-1}(x=-1)=\pi ; \ \ \ g^{-1}(x=1)=2\pi$$
and:
$$\int_{-1}^{1} \frac{1}{\sqrt{1 - x^2}} dx = \int_{\pi}^{2\pi} \frac{-sin(\theta)}{\sqrt{(sin(\theta)^2}} d\theta = \int_{\pi}^{2\pi} -d\theta = -\pi$$

I know the answer has to be $$\pi$$ because the integrand in terms of the original variable is always positive for $$x\in (-1,1)$$, thus the integral has to be positive. And I know that different signs I'm getting is because in one case my transformation is such that $$\theta$$ is increasing with increasing x (ie. $$g'>0$$) and in the other $$\theta$$ is decreasing with increasing x (ie. $$g'<0$$), but . . . the sign of $$g'<0$$ should compensate the change in the order of the limits of integration and I shouldn't have to worry about that, no? I just can't see what I'm doing wrong in either case, although I'm certainly doing something wrong!:(

2. Mar 12, 2009

### Chaos2009

I'm not sure if this helps but I recognize that:
$$\frac{d}{dx}(arcsin(x)) = \frac{1}{\sqrt{1 - x^2}}$$
$$where -\frac{\pi}{2} < x < \frac{\pi}{2}$$

3. Mar 13, 2009

### sutupidmath

People always forget that:

$$\sqrt{x^2}=|x|$$ and not simply x.

Frankly, i didn't bother to look your whole work, but i think that your problem is, as i just stated:

$$\sqrt{sin^2(\theta)}=|sin(\theta)|$$

and not as you, somewhere along the lines, have done simply sin(@) (@=theta)

Now, i assume you know the definition of the abs value, right? Well, in case you cannot recall while reading this post:

|x|=x if x>0 and -x if x<0.

Now:

|sin(@)|=sin(@) if sin(@)<0 and -sin(@) if sin(@)>0

Look at your limits of integration, pi to 2pi. what do you notice???? THis is your problem..

4. Mar 14, 2009

### BobbyBear

sutupidmath, . . . yes!
that includes me

My problem was not with the change of variable theorem after all :P Now everything falls into place :)

Fanku, fanku, I am much indebted :P

5. Mar 14, 2009

### BobbyBear

Thanku to Chaos2009 as well for their observation:P

6. Mar 14, 2009

### sutupidmath

this should have read |sin(@)|=sin@ if sin@>0 and -sin@ if sin@<0