# HP Forums

Full Version: Any way to solve parametric inequations?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Trying solve(((x*y)/((x+y)^2))≤0,x) gives a warning about parametric inequations and no result, even after assuming(x, INT_DOM) and for y too.
I’m guessing this question might have been mooted because it pertains to a more complex / general use of the solve function — i.e., that the particular inequality given is not of direct interest (that the solve function is playing a part in a larger mathematical inquiry — a use of it is embedded in a larger CAS program, for example — or, perhaps, there is an interest in better understanding the CAS).

But, if not — if xy/(x+y)^2≤0, for integer x and y, is the object of direct interest — a related plot can be brought up in the Advanced Graphing app.

[attachment=9785]
(09-05-2021 04:30 PM)jte Wrote: [ -> ]I’m guessing this question might have been mooted because it pertains to a more complex / general use of the solve function — i.e., that the particular inequality given is not of direct interest (that the solve function is playing a part in a larger mathematical inquiry — a use of it is embedded in a larger CAS program, for example — or, perhaps, there is an interest in better understanding the CAS).

But, if not — if xy/(x+y)^2≤0, for integer x and y, is the object of direct interest — a related plot can be brought up in the Advanced Graphing app.

Yes, the Advanced Graphing app (which I think is the best thing about anything relating to the Prime) provides a great way to study these kind of inequations. Algebraically though, the Prime CAS is unable to provide any context or clue in about the inequation behavior, while other simpler CAS such as the TI89's can.
(09-07-2021 09:48 PM)dah145 Wrote: [ -> ]
(09-05-2021 04:30 PM)jte Wrote: [ -> ]I’m guessing this question might have been mooted because it pertains to a more complex / general use of the solve function — i.e., that the particular inequality given is not of direct interest (that the solve function is playing a part in a larger mathematical inquiry — a use of it is embedded in a larger CAS program, for example — or, perhaps, there is an interest in better understanding the CAS).

But, if not — if xy/(x+y)^2≤0, for integer x and y, is the object of direct interest — a related plot can be brought up in the Advanced Graphing app.

Yes, the Advanced Graphing app (which I think is the best thing about anything relating to the Prime) provides a great way to study these kind of inequations.

Has anyone ever told you that flattery will get you everywhere in life? I’m glad you appreciate the Advanced Graphing app. Thanks!

That said, there are definitely some shortcomings in the Advanced Graphing app that I’d like to address / improvements that I’d like to make. Just earlier today I was playing around with some graphs — plotting n that can be expressed as a sum of powers of two integers (n = a^k + b^k; I was inspired by https://www.hpmuseum.org/forum/thread-13468.html) — and naturally came across graphs which could be better plotted… The changes I’ve thought of making to the Advanced Graphing app in the near term, though, involve more common uses of the app.
(09-07-2021 09:48 PM)dah145 Wrote: [ -> ]Yes, the Advanced Graphing app (which I think is the best thing about anything relating to the Prime) provides a great way to study these kind of inequations. Algebraically though, the Prime CAS is unable to provide any context or clue in about the inequation behavior, while other simpler CAS such as the TI89's can.

What kind of inequalities do you solve on the ti89?
The OP may have been referring to the ti-89 titanium which returns:

x+y≠0 and x≥0 and y≤0 or x+y≠0 and x≤0 and y≥0

CAS> assume(y≥0)
CAS> solve(x*y/(x+y)^2 ≤ 0, x) ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ → {x<(-y),(x>(-y)) AND (x≤0)}
CAS> assume(y<0)
CAS> solve(x*y/(x+y)^2 ≤ 0, x) ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ → {(x≥0) AND (x<(-y)),x>(-y)}

Or, for y≠0, reduce to simple inequality, with t = x/y

CAS> solve(t/(t+1)^2 ≤ 0, t) ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ → {t<-1,(t>-1) AND (t≤0)}
(09-13-2021 07:42 PM)Albert Chan Wrote: [ -> ]CAS> assume(y≥0)
CAS> solve(x*y/(x+y)^2 ≤ 0, x) ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ → {x<(-y),(x>(-y)) AND (x≤0)}
CAS> assume(y<0)
CAS> solve(x*y/(x+y)^2 ≤ 0, x) ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ → {(x≥0) AND (x<(-y)),x>(-y)}

Nice! It was fun seeing this … & trying it myself! Good for us to be reminded of the power and versatility of the CAS.

(Maybe some of my joy here, with this, was influenced by my difficulties in getting a government website to produce a QR code for me that wasn’t needlessly blurry. argh!)

(09-13-2021 07:42 PM)Albert Chan Wrote: [ -> ]Or, for y≠0, …

… hmmm, yes… what about when y is zero (with the above)? Is a little touching-up appropriate?

(09-13-2021 07:42 PM)Albert Chan Wrote: [ -> ]…reduce to simple inequality, with t = x/y

CAS> solve(t/(t+1)^2 ≤ 0, t) ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ → {t<-1,(t>-1) AND (t≤0)}
(09-13-2021 07:42 PM)Albert Chan Wrote: [ -> ]Or, for y≠0, reduce to simple inequality, with t = x/y

CAS> solve(t/(t+1)^2 ≤ 0, t) ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ → {t<-1,(t>-1) AND (t≤0)}
(09-13-2021 09:33 PM)jte Wrote: [ -> ]… hmmm, yes… what about when y is zero (with the above)? Is a little touching-up appropriate?

For x≠0, y=0, (x*y)/(x+y)^2 = 0/x^2 = 0 (is a solution)
For x = y = 0, we have 0/0 situation. (not a solution)

Or, define t = x/y if y≠0 else y/x (t = NaN will never satisfy)

Even with some edge cases, I still prefer dimensionless solution
(09-14-2021 12:55 AM)Albert Chan Wrote: [ -> ]
(09-13-2021 07:42 PM)Albert Chan Wrote: [ -> ]Or, for y≠0, reduce to simple inequality, with t = x/y

CAS> solve(t/(t+1)^2 ≤ 0, t) ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ → {t<-1,(t>-1) AND (t≤0)}
(09-13-2021 09:33 PM)jte Wrote: [ -> ]… hmmm, yes… what about when y is zero (with the above)? Is a little touching-up appropriate?

Oh! Now I see that I wasn’t clear with “with the above” (sorry about that!); by that I meant all the way up to the x,y solution for non-negative y (this is why I cut into the post mid-sentence, so that t’s introduction would be below rather than above); or, in other words, up to the following:

(09-13-2021 07:42 PM)Albert Chan Wrote: [ -> ]
CAS> assume(y≥0)
CAS> solve(x*y/(x+y)^2 ≤ 0, x) ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ → {x<(-y),(x>(-y)) AND (x≤0)}

(It seems to me that the x>0,y=0 portion is missing.)

(09-14-2021 12:55 AM)Albert Chan Wrote: [ -> ]
Even with some edge cases, I still prefer dimensionless solution

Yes — I’m glad my getting another chance to write lets me express my appreciation for seeing the t=x/y approach (or t=y/x)! I enjoyed imagining a line going through the origin with the slope varying, and thinking how that related to the problem (and your given solution set for t).
(09-14-2021 05:13 AM)jte Wrote: [ -> ]
(09-13-2021 07:42 PM)Albert Chan Wrote: [ -> ]
CAS> assume(y≥0)
CAS> solve(x*y/(x+y)^2 ≤ 0, x) ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ → {x<(-y),(x>(-y)) AND (x≤0)}

(It seems to me that the x>0,y=0 portion is missing.)

Good catch ! Another bug report ...

Perhaps it should be setup with 2 assumes (y≥0, y≤0), like ti-89 solution.
Or, "safer" assumes (y>0, y<0), and handle y==0 edge case separately.
Better yet, implement CAS do assume stuff automatically !

(09-13-2021 07:42 PM)Albert Chan Wrote: [ -> ]Or, for y≠0, reduce to simple inequality, with t = x/y

CAS> solve(t/(t+1)^2 ≤ 0, t) ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ → {t<-1,(t>-1) AND (t≤0)}

Translate t = x/y back to (x,y) world ...
First, edge case out of the way: if (y==0) then return (x!=0)

(SIGN(x)!=SIGN(y)) AND (x!=-y)

With SIGN(), we could remove test for edge case
Unfortunately, CAS SIGN() have bugs (HOME side, SIGN() seems OK)

CAS> SIGN([-1E-10, 0., 1E-10] ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ → [-1., 0., -1.]
CAS> SIGN([-1E-12, 0., 1E-12]) ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ → [0., 0., 0.]
CAS> SIGN(+inf) ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ → 1
CAS> SIGN(1E400) ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ → undef
(09-14-2021 09:35 AM)Albert Chan Wrote: [ -> ]Perhaps it should be setup with 2 assumes (y≥0, y≤0), like ti-89 solution.
Or, "safer" assumes (y>0, y<0), and handle y==0 edge case separately.

WolframAlpha does the safe way: solve x*y/(x+y)^2 <= 0, for (y,x)

Code:
```y < 0: (0 ≤ x < -y) OR (x > -y)  y = 0: (x < 0) OR (x > 0) y > 0: (x < -y) OR (-y < x ≤ 0)```
As a human, trying to understand xy/(x+y)^2≤0, for real x and y, one approach would be to handle (0,0) separately first and then look at the punctured plane, R^2\{(0,0)}.

… so… doing that…

Realizing that (x,y) is a solution iff (kx,ky) is, for positive k, lets us change our focus from R^2\{(0,0)} to the unit circle (each point on the circle is then a representative for an open ray from the origin), or — better yet — for nonzero k, which lets us consider half of a unit circle (each point on the half circle is then a representative for a punctured line through the origin).

If we pick the northeast half circle (x^2+y^2=1 s.t. y≥-x … although we only need one of the half circle’s end points), we can then exploit the symmetry that (x,y) is a solution iff (y,x) is to fold the half circle over y=x and consider just the upper quarter of a unit circle, x^2+y^2=1 s.t. y≥.5sqrt(2) (now each point is a representative of two punctured lines, or we could unfold our solution later before expanding back to the punctured plane). Looking at xy/(x+y)^2, one can see where the solutions are (from the left endpoint, not including it, to the halfway point, including it).

I’m not quite sure how this relates to automated solving / automated presentation of results. But considering symmetries etc. is certainly part of mathematics.
I will probably have to try, but I bet that the TI89 can only solve non linear inequations that can be reduced to linear inequations by factorization. In other words, something that a human can easily do himself once factor has been done. And a symbolic answer won't really help much except in very simple cases (where axis are involved), one needs a graphical representation, that's precisely what I'm coding right now, e.g. session Xcas
Reference URL's
• HP Forums: https://www.hpmuseum.org/forum/index.php
• :