Loading [MathJax]/jax/output/HTML-CSS/jax.js

First time here? Check out the FAQ!

Ask Your Question
1

Square root of a fraction

asked 3 years ago

keko gravatar image

updated 3 years ago

I have the following variable and function:

var('r')
f = function('f')(r)

with an equation given by:

eq = sqrt(-1/(f^2*sin(r)^2))-1/sqrt(-f^2*sin(r)^2)

which, in LaTeX expression, looks like:

1f(r)2sin(r)21f(r)2sin(r)2

In principle, this should be equal to zero. However,

bool(eq==0)

gives me False. I have tried with .simplify_full() and following the suggestion in here, I have used ._sympy_().simplify():

eq = eq._sympy_().simplify()
bool(eq==0)

but I still get False. Am I missing something?

Preview: (hide)

2 Answers

Sort by » oldest newest most voted
2

answered 3 years ago

cav_rt gravatar image

By doing

1f(r)2sin(r)21f(r)2sin(r)2=if(r)2sin(r)21if(r)2sin(r)2=2if(r)2sin(r)2

I wouldn't expect bool(eq==0) to return True.

You can deal with square roots using canonicalize_radical().

eq.canonicalize_radical()

returns 2if(r)sin(r).

Preview: (hide)
link
0

answered 3 years ago

keko gravatar image

I have realized that my problem here was of mathematical nature rather than computational. I was assuming that

ab=ab ab=ab ab=ab

However, if we consider only the positive branches of the square roots, the last equality does not hold.

Preview: (hide)
link

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: 3 years ago

Seen: 383 times

Last updated: Dec 15 '21