Solving a System of Nonlinear Equations Symbolically

Click For Summary

Discussion Overview

The discussion focuses on the use of a computer algebra system (CAS) to symbolically solve systems of nonlinear equations. Participants explore the feasibility of using iterative substitution methods to derive one variable in terms of others, while considering the complexities and limitations of symbolic solutions in various cases.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant describes a method using the JavaScript library Nerdamer to solve systems of nonlinear equations iteratively, expressing concerns about the symbolic solvability of each step.
  • Another participant points out that the situation is more complex than a single quadratic equation, suggesting that assumptions must be clearly stated for meaningful answers.
  • Some participants emphasize that even if a system can be solved symbolically, it may yield multiple solutions or require parametrization, complicating the iterative approach.
  • A participant raises a specific example of polynomials that cannot be solved exactly, questioning the effectiveness of the proposed algorithm in finding solutions.
  • Another participant acknowledges the limitations of their approach, noting that their algorithm should ideally match human capabilities in solving through substitutions.
  • There is a discussion about the need for the algorithm to iterate through different sequences of substitutions to find a workable solution.

Areas of Agreement / Disagreement

Participants express varying opinions on the feasibility of the proposed method, with some agreeing that the algorithm could work under certain conditions, while others highlight significant limitations and complexities that could hinder its effectiveness. No consensus is reached on the overall viability of the approach.

Contextual Notes

Participants note that the condition of being able to solve the system symbolically is often too strong, as many systems may not yield symbolic solutions. Additionally, the discussion acknowledges the potential for multiple solutions and the need for careful consideration of the specific forms of equations involved.

person123
Messages
326
Reaction score
52
TL;DR
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
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.
 
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?
 
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.
 
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.
 
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   Reactions: person123
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.
 
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.
 
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   Reactions: person123

Similar threads

  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 35 ·
2
Replies
35
Views
4K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K