-1

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?

miracle173
  • 11,359
Chen Yu
  • 125
  • 5
    What a bunch of irrelevant answers... – Asaf Karagila Aug 13 '16 at 10:48
  • 2
    @Asaf Karagila Well the question is silly. Does it matter why Maxima simply returns $[\sqrt(x^2-22x+134)=\sqrt(x^2-6x+54)]$ as a result of the input solve(sqrt(x^2-22x+134)-sqrt(x^2-6x+54)=0,x) if the problem can be solved by hand or if, when the equation is written more sensibly when input into Maxima, solve works fine. – smcc Aug 13 '16 at 10:54
  • @smcc: Whether or not this is a bad question is irrelevant. And sure, it might be off-topic altogether, or just missing some context. But I don't remember programming compilers that automatically write filesystem drivers and operating systems when I was trying to learn how to program. I do remember writing a lot of silly examples. Can you tell, in advance, if this is an attempt to understand Maxima, or just solve one equation? I sure as hell can't. But I can say that when someone tells you that their fish is dead, the right answer is not "have you looked under the fridge?" – Asaf Karagila Aug 13 '16 at 10:58
  • 1
    That being said, if the question had been "Why do solve(sqrt(x^2-22x+134)-sqrt(x^2-6x+54)=0,x) and solve((x^2-22x+134)-(x^2-6x+54)=0,x) return different output in Maxima?" I think it would have been a good question if OP's intention is to learn about the solve function in Maxima. – smcc Aug 13 '16 at 10:58

2 Answers2

2

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.

smcc
  • 5,798
1

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])
miracle173
  • 11,359
  • Hi @Dr.SonnhardGraubner I have hijacked your answer to add a Maxima solution. The question is closed so no new answer can be added. I hope this is ok, otherwise feel free to roll back my edit. – miracle173 Jan 17 '20 at 17:28