Skip to main content
3-Newcomer
Sep 7, 2025 9:53 PM UTC
Question

How to find all solutions of equation (with two variables)

Hi 🙂

How can I solve this equation f(a,b) = 0 ? Orange plot - f(a,b), grey plot is zero surface, so as you can see orange plot intersects grey plot 4 times, so there should be 4 solutions. Root() works fine, but by this method I have to change manually  guess/initial values. Is it possible to get all solutions together for ex. in a matrix ?

 

AB_14100650_0-1757281852877.png

 

4 replies

Werner_E
25-Diamond I
Sep 7, 2025 11:57 PM UTC

Where is the worksheet?

 

Only automatic way to get all solutions is symbolic calculation using "solve", maybe with additional modifier "fully", but Primes symbolics (FriCas/Axiom) often is to weak and fails to deliver solutions, let alone all of them.

You could write a program which cycles through x and y values within given ranges, uses them as guess values for a numeric solve (either a solve block with "find" or the "root" function), collects the solutions in a matrix and to finish sort the solution matrix and remove duplicate values.
That may work, but there is no guarantee to get really all solutions and maybe you get the same solution multiple times because they are considered different due to tiny round off errors.

 

In your case its quite easy. For each value of x there is a solution. That way the matrix with all solutions you are asking for would be too large for Prime - after all there is an infinite number of solutions ... 😉

You simply can symbolically solve f(x,y) for y and you get a function g(x) which consists of all solutions:

Werner_E_0-1757292339741.pngWerner_E_3-1757295933394.png

 

Can also be done in Prime, but of course with a much more limited 3Dplot (no transparency, no contour lines, no lighting and much more artefacts at the border where the surface is extremely steep, and ... you name it, Prime is missing it 😉 )

Werner_E_1-1757295716901.png

 

 

 

Translate
3-Newcomer
Sep 8, 2025 6:51 AM UTC
Thank you for answer 🙂

Translate
19-Tanzanite
Sep 8, 2025 7:37 AM UTC

As Werner has noted there are an infinite number of solutions.  Perhaps the easiest way to see that is as follows:

InfiniteSolns.png

 

Alan

Translate
Community Moderator
Sep 12, 2025 4:46 AM UTC

Hello @AB_14100650,

 

It looks like you have some responses from some community members. If any of these replies helped you solve your question please mark the appropriate reply as the Accepted Solution. 

Of course, if you have more to share on your issue, please let the Community know so other community members can continue to help you.

Thanks,
Vivek N.
Community Moderation Team.

Translate