Ask Your Question
1

How to remove radicals from an equation

asked 2023-07-31 17:51:11 +0100

vidyarthi gravatar image

updated 2023-07-31 19:42:18 +0100

If an equation has several radicals, is it possible to remove the radicals to get a radical free equation in SageMath? The simplify_radical() method seems not to exist in SageMath. The canonicalize_radical() seems to do nothing. For example,

E=a^2 + b^2 + c^2 + sqrt(a^2 + b^2 + c^2)==0
E.canonicalize_radical()

gives the output same as E

Any alternative? Thanks beforehand.

edit retag flag offensive close merge delete

Comments

You may not do more, except if you may want to explicitly introduce further solutions. Just use a new letter for the radical, and make all equations algebraic. This may be a step backwards in the solution, but it is a step forwards in the question. In the given example, you may consider - by introducing new solutions - instead of $E$ the equation $$(a^2+b^2 +c^2+\sqrt{a^2 +b^2+c^2})(a^2+b^2 +c^2-\sqrt{a^2 +b^2+c^2})=0$$then expand and factorize...

dan_fulea gravatar imagedan_fulea ( 2023-08-01 01:28:35 +0100 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2023-08-01 09:17:06 +0100

Emmanuel Charpentier gravatar image

@dan_fulea's answer is correct, but you may avoid the hassle of driving yourself the transformations by using Sympy's unrad function :

sage: var("a, b, c")
(a, b, c)
sage: Eq=a^2 + b^2 + c^2 + sqrt(a^2 + b^2 + c^2)==0
sage: from sympy.solvers.solvers import unrad
sage: unrad(Eq._sympy_())
(a**4 + 2*a**2*b**2 + 2*a**2*c**2 - a**2 + b**4 + 2*b**2*c**2 - b**2 + c**4 - c**2,
 [])

Note that this function returns a (system of) equation(s) whose roots include the roots of the original equation ; you will have to filter them bu checking that the candidate root indeeded satisfy the original equation.unrad?. Example :

sage: [(s, Eq.subs(s)) for s in unrad(Eq._sympy_())[0]._sage_().solve(a, solution_dict=True)]
[({a: -sqrt(-b^2 - c^2 + 1)}, 2 == 0),
 ({a: sqrt(-b^2 - c^2 + 1)}, 2 == 0),
 ({a: -sqrt(-b^2 - c^2)}, 0 == 0),
 ({a: sqrt(-b^2 - c^2)}, 0 == 0)]

By squaring, unrad added solutrions of the transformed equation which are not roots of Eq.

For details, unrad?...

HTH,

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2023-07-31 17:51:11 +0100

Seen: 260 times

Last updated: Aug 01 '23