Solving a System of Nonlinear Equations Symbolically

In summary, the approach of using a CAS to solve systems of nonlinear equations symbolically may not always work perfectly, as there can be cases where it cannot find all possible solutions. This is especially true for complex equations involving polynomials with no exact solution. However, for simpler systems of engineering or science equations, the approach may be effective in finding solutions. It is important to be aware of potential limitations and to consider alternative methods, such as iteration through possible substitutions, in order to find solutions.
  • #1
person123
328
52
TL;DR Summary
If a system of nonlinear equations can be solved symbolically, can it be solved symbolically through an any series of repeated substitutions?
Hi. I would like to use a CAS to solve systems of nonlinear equations symbolically. The JavaScript library Nerdamer can solve single nonlinear equations symbolically shown here, and I would like to use that function iteratively to solve systems. For example, if I have a system of three equations with variables ##a##, ##b##, ##c##, and ##d##, and I wanted ##a(b)##, then I would:
  1. Solve equation 1 for ##d(a,b,c)##
  2. Substitute equation 1 into equation 2 and 3
  3. Solve equation 2 for ##c(a,b)##
  4. Substitute equation 2 into equation 3
  5. Solve equation 3 for ##a(b)##
My fear is that the system of equations might be solvable symbolically, but not all these steps could be done symbolically. (Of course it also might not be solvable symbolically, in which case it's fine to just not return a solution). If the system can be solved symbolically, does that mean all of these steps can also be performed symbolically? Is there a better approach? Thank you!

(As a side note, the JavaScript library Nerdamer can solve systems of nonlinear equations shown here, but only if there are numeric solutions for all variables, so equal number of unknowns and equations. I don't think I could use it to find one variable in terms of other variables).

(I also realized I could iterate through possible sequences of substitutions so in case one doesn't work, it can use another one. That way if a person can solve it through substitution specifically, this should be guaranteed to find the solution as well).
 
Last edited:
Mathematics news on Phys.org
  • #2
The situation is a bit more complicated than in your example with a single(!), quadratic(!) equation. This means in return, that you silently used specific conditions to make your example work, but which you did not assume to generally hold in your question.

Hence do you expect an answer for some specific case, or for the general case? The latter is subject to algebraic geometry (in case your equations are polynomial equations), and differential geometry (in case you allow any equations). Both are huge fields where entire lecture(s) can be given, i.e. there is no way to answer it here in a single thread. If you meant specific cases, please list all assumptions we can make.
 
  • #3
fresh_42 said:
The situation is a bit more complicated than in your example with a single(!), quadratic(!) equation.
I meant the system of equations to be any arbitrary system of equations.

My only assumption is that the system of equations can be solved symbolically, or that there is some explicit form for ##a(b)##. If it can be solved, would my iterative approach allow me to solve it?
 
  • #4
If it can be solved uniquely, then yes. But even a quadratic equation has usually two different solutions, so you have to manage these possibilities. In general, however, there might be solutions that are an entire curve or surface, in which case you get a parametrization at best.

The condition "if it can be solved symbolically" is too strong to be useful, since it is rarely the case.
 
  • #5
fresh_42 said:
But even a quadratic equation has usually two different solutions, so you have to manage these possibilities. In general, however, there might be solutions that are an entire curve or surface, in which case you get a parametrization at best.
I forgot to consider that. The CAS would give multiple solutions (at least for quadratic equations), so I imagine I could just carry through the steps for both solutions.

fresh_42 said:
The condition "if it can be solved symbolically" is too strong to be useful, since it is rarely the case.
The reason for that condition is because if it cannot be solved symbolically, then I wouldn't expect any code I write to be able to do it. I was thinking of my condition as basically asking this: if it is possible to do, would my approach do it?

To clarify a bit on what my goal with this is: this would probably be just for simple systems of engineering/science equations where a person could plug variables into equations to solve them. I realize my question was very broad, as I wanted to know if it would work in general, but I don't really need to consider complex situations.
 
  • #6
I think this is not going to work perfectly. Here's an example. Let ## f(x)## and ##g(y)## be arbitrary complicated polynomials that cannot be solved exactly even when we add some constants and linear terms, I'm pretty sure polynomials like this exist. Let's also pick them such that ##x=1## is a root of ##f(x)## (you can take any unsolvable polynomial and multiply by ##(x-1)## to get this) and ##-1## is a root of ##g(y)##
let's also Then consider
##f(x)+g(y)+x+y=0##
##f(x)-g(y)+x+y=0##

Neither of these equations let's you solve for one variable in terms of another, but ##(1,-1)## is a fairly simple solution for a human to derive.

I'm not sure if this counts as a "symbolic solution", and there are almost certainly additional solutions that I cannot find, but your algorithm won't even find this solution I think.
 
Last edited:
  • Wow
Likes person123
  • #7
Office_Shredder said:
I think this is not going to work perfectly. Here's an example. Let ## f(x)## and ##g(y)## be arbitrary complicated polynomials that cannot be solved exactly even when we add some constants and linear terms, I'm pretty sure polynomials like this exist. Let's also pick them such that ##x=1## is a root of ##f(x)## (you can take any unsolvable polynomial and multiply by ##(x-1)## to get this) and ##-1## is a root of ##g(y)##
let's also Then consider
##f(x)+g(y)+x+y=0##
##f(x)-g(y)+x+y=0##

Neither of these equations let's you solve for one variable in terms of another, but ##(1,-1)## is a fairly simple solution for a human to derive.

I'm not sure if this counts as a "symbolic solution", and there are almost certainly additional solutions that I cannot find, but your algorithm won't even find this solution I think.
Thank you! Yes, that was the kind of issue I was looking for. I think for now my algorithm should be good enough, and it's good to be aware that situations like this can arise.
 
  • #8
In fact here's a specific proof you can pick an appropriate f for this to work. Let ##p(x)## be the generic quintic polynomial (so symbolically unsolvable). Then ##(x-1)p(x)+x+h(y)## cannot be solvable for x treating y/h(y) as a constant - if it is, you could plug in ##-1## for the ##h(y)## term, and then get ##(x-1)(p(x)+1)## is solvable. But ##p(x)+1## is still just a generic quintic so is not solvable.
 
  • #9
Thank you once again.

Thinking about it more, all I would really expect from my algorithm is to be able to solve what a human could solve through repeated substitutions. I also realize that my algorithm would sometimes fail for more obvious reasons; for example equation 1 might not have ##d## in it. I would just have to make it iterate through different sequences of substitutions until one works. If it's able to iterate through all possible sequences of substitution, it would of course be able to solve the problem if the problem could be solved through substitution. Therefore, it seems (kind of trivially) that I would be able to do what I would actually be hoping for.
 
  • #10
I think I agree with you there.
 
  • Like
Likes person123

FAQ: Solving a System of Nonlinear Equations Symbolically

How do I solve a system of nonlinear equations symbolically?

To solve a system of nonlinear equations symbolically, you can use various methods such as substitution, elimination, or graphing. You can also use specialized software or calculators that have built-in functions for solving systems of equations.

What is the difference between solving equations symbolically and numerically?

Solving equations symbolically means finding the exact solution using algebraic methods, while solving numerically means finding an approximate solution using numerical methods such as iteration or approximation algorithms.

Can all systems of nonlinear equations be solved symbolically?

No, not all systems of nonlinear equations can be solved symbolically. Some equations may have no exact solution or may require advanced mathematical techniques to solve them symbolically.

Are there any limitations to solving systems of nonlinear equations symbolically?

Yes, there are some limitations to solving systems of nonlinear equations symbolically. For example, the equations must be well-defined and have a finite number of solutions. Additionally, the equations should not be too complex to solve using algebraic methods.

How can solving systems of nonlinear equations symbolically be useful in real-life applications?

Solving systems of nonlinear equations symbolically can be useful in many real-life applications such as engineering, physics, and economics. It can help in finding the optimal solution to a problem, predicting future trends, and understanding the behavior of complex systems.

Similar threads

Replies
8
Views
2K
Replies
7
Views
1K
Replies
12
Views
2K
Replies
3
Views
1K
Replies
2
Views
902
Replies
1
Views
999
Replies
5
Views
2K
Replies
1
Views
9K
Back
Top