# Need to Solve this Equation

1. Oct 3, 2007

### ColdFusion85

I need to use a program to numerically solve the following equation:

$$exp(-2.222)=\frac{(\frac{2x}{2+2x})^2(\frac{x}{2+2x})}{(\frac{2-x}{2+2x})^2}$$

I tried using Matlab to solve it but I kept on getting an error message. I'm not a programmer or familiar with these numerical solvers at all. Is there some place online I can solve this equation, or can someone post the Matlab code to solve it? The code is not part of the homework, but I arrived at the above equation and need to solve it in order to finalize my answer, so if anyone could help me solve it that would be great. Thanks.

2. Oct 3, 2007

### Avodyne

Well, you can simplify the right-hand side quite a bit. Ultimately you can turn it into a cubic equation for x.

3. Oct 3, 2007

### D H

Staff Emeritus
First, simplify the expression. Then reformulate it in the form $f(x)=0$.

You now have something amenable to the zero finding functions.

$x=2$ and $x=-1$ are obviously problematic. You want to find a pair of $x$ values $x_1$ and $x_2$ such that neither of the poles is between $x_1$ and $x_2$ and such that $f(x_1)$ and $f(x_2)$ have opposite signs. There is a zero between these points.

Last edited: Oct 3, 2007
4. Oct 3, 2007

### D H

Staff Emeritus
Not quite that much. You get a rational polynomial, a simple cubic divided by a quadratic.

EDIT: I worked to much today.

Ultimately, you're right. Simplifying the RHS leads to $p(x)/q(x)-c=0$ where $p(x)$is cubic and $q(x)$ is quadratic. Multiplying by $q(x)$ yields $p(x)-cq(x)=0$, a cubic.

Last edited: Oct 3, 2007
5. Oct 3, 2007

### ColdFusion85

For the RHS I expanded everything out and got this:

$$\frac{4x^3(4x^2+8x+4)}{(8x^3+24x^2+24x+8)(x^2-4x+4)}$$

Is this correct?

6. Oct 3, 2007

### D H

Staff Emeritus
Don't expand! Get rid of the common factor instead. Look at the numerator and denominator.

7. Oct 3, 2007

### ColdFusion85

Oh, ok so one gets:

$$\frac{4x^3}{(2-x)^2(2+2x)}$$?

8. Oct 3, 2007

### D H

Staff Emeritus
Yes. You can also get rid of a factor of two. And oops, I said cubic/quadratic. What you have is a ratio of two cubics, which is correct. Now multiply through by the denominator to get a cubic equation (valid so long as x is not 2 or -1).