Solve and checkLesson 16 of 48 · 7 min

Solve a nonlinear system

Keep all branches of a nonlinear system and verify complete candidate pairs.

Maths refresher: Intersections of curves

A common solution of two curve equations is a point lying on both curves.

x2+y2=5,y=x−1⇒x∈{−1,2}x^2+y^2=5,\quad y=x-1\quad\Rightarrow\quad x\in\{-1,2\}
Worked example

Substituting y=x−1y=x-1 gives 2x2−2x−4=02x^2-2x-4=0. The points are (−1,−2)(-1,-2) and (2,1)(2,1).

Maths prerequisite map ↗

Nonlinear equations can have several isolated solutions or larger families. nonlinsolve returns sets of tuples so those joint branches remain visible. Do not select a convenient branch before stating which extra conditions justify the selection.

See the mathematics
(-1, -2)(2, 1)
(-1, -2)(2, 1)
x2+y2=5,y=x−1x^2+y^2=5,\quad y=x-1
Starter reference. A line and circle intersect at two complete coordinate pairs. Both satisfy the original equations; selecting a branch needs an additional constraint.

Intersect a circle with a line. Substituting the line relationship into the circle creates a quadratic, so two intersection points are plausible. The example checks both returned pairs against both original residuals.

A physical interpretation may require positive coordinates or a bounded region, but those are extra constraints. Include them explicitly and explain any excluded branch. General nonlinear systems can be much harder, and solver output may contain parameters or unresolved conditions.

Should a solver return only the intersection with positive coordinates when no sign constraint was supplied?

Write a prediction (optional)

Exact symbolic investigation

Select Run Python with the code unchanged.

Tools
About Python

Python and the course packages can load while you read. Each run starts with fresh user variables; imported modules stay loaded. Stop replaces the worker. Runtime details ↗

Ctrl+Enter or ⌘+Enter runs Python.

Compare with the worked example

Executed from the published Python during the site build. Your own run appears above. Build environment ↗

Intersection points
{(−1, −2),(2, 1)}\left\{\left( -1, \ -2\right), \left( 2, \ 1\right)\right\}
Original checks
[(0, 0), (0, 0)]\left[ \left( 0, \ 0\right), \ \left( 0, \ 0\right)\right]
Worked text output
Intersection points: {(-1, -2), (2, 1)}
Original checks: [(0, 0), (0, 0)]

Read the starter result

Intersection points gives full coordinate pairs. Each pair has two zero residuals in Original checks. A later model restriction could exclude one pair.

Edit and compare

In the residuals line, replace x**2+y**2-5 with x**2+y**2-1. Select Run Python. Compare Intersection points with the first run, then read Original checks for both revised coordinate pairs.

Return to the editor

Scope. This system has finite elementary solutions. General nonlinear solving can return parametric or incomplete symbolic descriptions.

Try a fresh case

A nonlinear solver finds two valid branches. A model permits only positive x. What next?

Choose an answer
Need a hint?
Hint 1

Separate the equations from extra admissibility conditions.

Hint 2

Check each candidate against the explicit condition.

Your notesNotes save in this browser when storage is available.