In maxima, why the following can't find root?

2.7k Views Asked by At

Why the following equation can't find root? Solve $\sqrt{x^2-22x+134}-\sqrt{x^2-6x+54}=0$

(%i1)  solve(sqrt(x^2-22*x+134) -sqrt(x^2-6*x+54),x);                 
                        2                       2
(%o1)            [sqrt(x  - 22 x + 134) = sqrt(x  - 6 x + 54)]

By calculating by hand, it is simple. My question is why can't find root?

2

There are 2 best solutions below

0
On BEST ANSWER

From the Maxima manual entry for the function solve

"Solves the algebraic equation $\text{expr}$ for the variable $x$ and returns a list of solution equations in $x$... $\text{expr}$ may be a rational expression, and may contain trigonometric functions, exponentials, etc."

Given the "etc", the manual is not very clear about which expressions solve works well on. But from experimentation, solve does not handle unsimplified expressions involving fractional exponents or logarithms very well.

For example Maxima returns an implicit solution (the equation itself) when attempting to use solve (with out any prior simplification) on any equation of the form

$$(x+1)^{n}=(2x)^{n},\quad \text{ where $n\in(0,1)$}$$ or $$\quad \ln(2x)=\ln(1+x).$$

If instead we help Maxima by simplifying first to get $x+1=2x$, then solve has no trouble returning the explicit solution.

1
On

your equation is $$\sqrt{(x^2-22x+134)}=\sqrt{(x^2-6x+54)}$$ squaring and simplifying we get $$-22x+134=-6x+54$$ and we get $$80=16x$$ or $$x=5$$ why maxima can not find the solution i dont know, i don't know the code


In this case we have to assist Maxima. We use the same idea, to calculate the solution. More complex cases can be handled like this.

(%i1) eq:sqrt(x^2-22*x+134)-sqrt(x^2-6*x+54)
                        2                       2
(%o1)             sqrt(x  - 22 x + 134) - sqrt(x  - 6 x + 54)
(%i2) s:solve(eq,x)
                        2                       2
(%o2)            [sqrt(x  - 22 x + 134) = sqrt(x  - 6 x + 54)]
(%i3) s:s^2
                         2                 2
(%o3)                  [x  - 22 x + 134 = x  - 6 x + 54]
(%i4) solve(s,x)
(%o4)                               [x = 5]

Or you can the function to_poly_solve

(%i2) load(to_poly_solve)$
(%i3) to_poly_solve(sqrt(x^2-22*x+134) -sqrt(x^2-6*x+54),x);
(%o3)                           %union([x = 5])