how to solve equation with square root

12242019, 07:30 AM
Post: #1




how to solve equation with square root
When using solve command to solve equation with square root, the calculator gives results including those negative value under square root. For example in the picture below.
solving equation Sqrt[x^2 + x 2] + Sqrt[x^2 + x 30] = Sqrt[2*x^2 + 2*x 32] The calculator give result : 6, 2, 1,5, which is correct. However, for some of them e.g 2, 1, when putting in x, it will give negative value under square root. if we want the calculator to return only nonnegative number under square root, what can we do? 

12242019, 04:22 PM
Post: #2




RE: how to solve equation with square root
Hey teerasak,
you could use the modulus: Otherwise you could save the domain into a variable (e.g. dom) and get the intersection with the equation: domain(sqrt((x^2)+x2)+sqrt((x^2)+x30)sqrt((2x^2)+2x32),x) > dom solve(sqrt((x^2)+x2)+sqrt((x^2)+x30=sqrt((2x^2)+2x32) and dom,x) Happy XMas holidays, Aries 

12242019, 04:23 PM
Post: #3




RE: how to solve equation with square root
(12242019 07:30 AM)teerasak Wrote: When using solve command to solve equation with square root, the calculator gives results including those negative value under square root. For example in the picture below. It seems that when using CAS these solvers do not regard the CAS Settings flag Complex: [ ] You have to feed the answers back to the original equation yourself to test if they give the Real domain answer. :( Simply unbelievable, but real: fsolve may even give odd complex results. 

12242019, 06:45 PM
Post: #4




RE: how to solve equation with square root
If complex is on (use i), solve returns real and complex solutions (like csolve), if complex mode is off, solve returns only real solutions. solve does not check if intermediate computations are done in the complex domain, you can run domain and assume to avoid this.


01032020, 06:58 AM
Post: #5




RE: how to solve equation with square root
thank you for all help.
@CyberAngel  Yeah, fsolve() returned weird result. I guess, it should be 1 as it is close to 1. 

01032020, 07:08 AM
Post: #6




RE: how to solve equation with square root
When using solve(Sqrt(x^2+x2) + Sqrt(x^2+x30) = Abs(Sqrt(2*x^2+2*x32)),x)
I expect it should fiter answer with intermediate complex number result, but it does not. Is it a bug? 

01032020, 02:40 PM
Post: #7




RE: how to solve equation with square root
(01032020 07:08 AM)teerasak Wrote: When using solve(Sqrt(x^2+x2) + Sqrt(x^2+x30) = Abs(Sqrt(2*x^2+2*x32)),x) Think of it if you solve this manually ... LHS and RHS both nonnegative. Square both side: \((x^2 + x  2) + (x^2 + x  30) + 2 \sqrt{(x^2 + x  2) (x^2 + x  30)} = 2x^2 + 2x 32\) \(2 \sqrt{(x^2 + x  2) (x^2 + x  30)} = 0\) Again, both side is nonnegative, square again: \(4(x^2 + x  2) (x^2 + x  30) = 4(x+2)(x1)(x+6)(x5) = 0 \) Note that above does not involve complex numbers. To remove "complex intermediates", we need RHS = \(2x^2 + 2x 32 ≥ 0\) With this extra constraint, we are left with 2 roots, x = 6, +5 

01032020, 02:45 PM
Post: #8




RE: how to solve equation with square root
(01032020 07:08 AM)teerasak Wrote: When using solve(Sqrt(x^2+x2) + Sqrt(x^2+x30) = Abs(Sqrt(2*x^2+2*x32)),x) Use CAS.domain to the original expression to see which answers are valid. It is always good to include domain to any answer 

01032020, 03:30 PM
Post: #9




RE: how to solve equation with square root
Just for the fun of it, I tried it on my CASIO fxcg50...it came up with 6 and 5.


01032020, 03:38 PM
Post: #10




RE: how to solve equation with square root
“domain” is a nice way to preselect the valid real results domain before using solve (was not aware of that command). Turns this into a 2 step procedure (surprised that this is the case). Thanks for this.


01032020, 04:47 PM
Post: #11




RE: how to solve equation with square root
I'm reminded of mathematical history, where nonreal intermediate values occurred when finding the real root of some cubic equations with real coefficients. (The imaginary parts of the intermediate values would cancel out in the final answer.) It's one of the main reasons for the initial acceptance of complex numbers as legitimate. Should such real roots be disallowed just because you need imaginary numbers to calculate them?
— Ian Abbott 

01032020, 08:15 PM
Post: #12




RE: how to solve equation with square root
A question...if in such an example as this, can I safely assume that, after using “domain” that all results that fall outside of the domain are correct complex results, that in this case, would be 2i and i?
The CASIO fxcg50 is a surprisingly good calculator, quite useful in graphical analysis. Surprised that it’s complex capability is not complete (ASIN 2.4 yields an error, for example). Surprised it will not find prime factors of a number. Also surprised that it has difficulty with integrals with undefined endpoints or within an interval (integral of 1/(5ROOT x1) from 0 to 33, as an example...even a TI 36X Pro can deal with this sort of problem). One is forced to divide into 2 integrals, or if endpoints are problematic, add or subtract 1 E 12 to the undefined endpoint as appropriate. 

« Next Oldest  Next Newest »

User(s) browsing this thread: 1 Guest(s)