HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →
Live examsInternational live exams are comingTell us which exam you want first. Timed practice papers are open now.See what is coming →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Space Science and Astronomy
  • Earth and Environmental Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
  1. Python Programming
  2. /Python for Science and Maths
  3. /Solving Equations

Solving Equations

Python Programming · High School (11–12) · 1 course, 10 worked problems, 20 practice questions

Many problems in science end with an equation to solve. Some equations have a neat formula, but many do not, such as x=cos⁡xx = \cos xx=cosx. A computer can close in on the root step by step. Bisection starts from two values that bracket the root and halves the gap each time. Newton's method uses the slope of the curve to jump closer, but it can fail near a flat point. NumPy finds the roots of a polynomial with np.roots() and solves a set of linear equations with np.linalg.solve(). Fitting a line or a curve to data finds the constants in a law.

With practice you will be able to

  • Find a root of an equation by bisection
  • Find a root with Newton's method and spot when it fails
  • Solve a set of linear equations with np.linalg.solve()

Lessons

  • Solving EquationsHow can you solve cos x = x with no formula? What makes Newton's method so fast?High School (11–12)

Practice questions

Choose an answer, then check it. Each one shows a full explanation.

For f(x) = x**2 - 16, with f'(x) = 2x, what does one Newton step from x = 5 give?

What does np.polyval([2, 0, -1], 3) give?

What is the determinant of the matrix [[2, 1], [4, 3]]?

A bracket is 1 wide. At least how many bisection steps make it narrower than 0.01?

Worked problems

Each one has a hint, the key idea and a full worked solution.

  • The equation x³ - 3x + 1 = 0 has three real roots between -3 and 3…Medium
  • A ball is thrown straight up at 15 m/s from the edge of a cliff that is 25 m above the sea…Medium
  • Use Newton's method to find √7 as the root of f(x) = x² - 7, starting from x₀ = 7…Medium
  • Try Newton's method on f(x) = √[3]x (use np.cbrt), which has the root x = 0…Hard
  • Find the roots of x⁴ - 10x² + 9 with NumPy…Medium

Python labs

  • Bisection
  • Newton's method
  • Polynomial tools
  • Fit a line
  • Solve the system
  • Project: the half-life

Related topics

  • Python for Science and Maths
  • NumPy Arrays
  • Graphs with matplotlib
  • Calculus by Computer
  • Simulation and Randomness
  • Data Analysis with pandas
  • Chemistry by Computer
  • Biology by Computer
  • Trigonometry and Waves by Computer

What must be true of f at the two ends a and b so that bisection can start?

A bracket has the width 1. About how wide is it after 10 steps of bisection?

Which line is one step of Newton's method for the function f with the derivative df?

What does np.roots([1, 0, 1]) give?

For which matrix does np.linalg.solve(A, b) raise a LinAlgError?

A student fits a line with np.polyfit(x, y, 1) and gets the array [2.0, 1.0]. The student says that the intercept is 2. What is wrong?

All 20 practice questions on Solving Equations →

A student measures the extension of a spring for five forces…
Medium
  • A meal is made from three foods, with x, y and z portions…Medium
  • A system Ax = b with n unknowns has one solution if the rank of A is n…Hard
  • The counts per second of a sample at 0, 5, 10, 15, 20, 25 and 30 minutes are 800, 566, 400, 283…Medium
  • A capacitor discharges through a resistor…Hard