Now that we have learnt about system of linear equations and how to solve it, let’s move on to non-linear system of equations.

Non-linear system of equations

Non-linear equations are equations that cannot be linearly plotted, plotted as a straight line graph, and hence the variables will have degrees higher than 1. An example of a non-linear equation is

$y=x^2+1$

A system of non-linear equations refers to a system of equations in which a non-linear equation is present, though not all equations inside the system needs to be non-linear. It also differs from a linear system as it can also have more than one solution. The following is an example of a non-linear system of equations with 2 equations with variables x and y.

$y=x+1$

$y=x^2+1$

The concept of solving a non-linear system of equations is similar to that of a linear system of equation, as we are trying to find the point of intersection for all of the graphs. Using the above system as an example, by plotting it in a graph,

And from the 2 points of intersection, we can deduce the 2 solutions, which are

$x=0$

$y=1$

and

$x=1$

$y=2$

We are also able to use substitution to obtain our results. Using the previous system as an example, we can use the equation

$x=y-1$

and substitute it into

$y=x^2+1$

$y=(y-1)^2+1$

$y=y^2-2y+1+1$

$0=y^2-3y+2$

By completing the root, we will get

\$latex 0=(y-2)(y-1)

				
%use s2
val f1:BivariateRealFunction = object : AbstractBivariateRealFunction() {
//Using AbstractBivariateRealFunction as we are only using 2 variables
override fun evaluate(x: Double, y: Double): Double {
//if the values are correct, it returns 0
return x + 1 - y
}}

val f2:BivariateRealFunction = object : AbstractBivariateRealFunction() {
//Using AbstractBivariateRealFunction as we are only using 2 variables
override fun evaluate(x: Double, y: Double): Double {
//if the values are correct, it returns 0
return x*x + 1 - y
}}

print(f1.evaluate(1.0,2.0))
print(f2.evaluate(1.0,2.0))



As systems of nonlinear equations becomes more complex, it will be harder to obtain solutions by substitutions or graphing. In the next chapter, we will be looking at the theory behind Newton’s method, as well as how to implement it in NMdev, to be able to find solutions to more complex non-linear systems.