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. /Calculus by Computer

Calculus by Computer

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

Calculus is about rates of change and areas under curves. A computer can work out both with numbers when a formula is hard or when the data comes from a table. A derivative can be estimated from two close points, f(x+h)−f(x)h\dfrac{f(x + h) - f(x)}{h}hf(x+h)−f(x)​, with a small step hhh. An area can be found by cutting it into thin strips and adding them, as in the trapezium rule. A rate equation, such as the cooling of a cup of tea, can be stepped forward in small time steps. In physics, the slope of a position graph gives velocity, and the area under a velocity graph gives displacement.

With practice you will be able to

  • Estimate a derivative from two close points
  • Find the area under a curve with the trapezium rule
  • Step a rate equation forward in time with small steps

Lessons

  • Calculus by ComputerHow do you find a slope with no formula? Why is the best throw below 45° in air?High School (11–12)

Practice questions

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

The forward difference (f(x + h) - f(x)) / h for f(x) = x**2 at x = 3 with h = 1 gives what?

The trapezoid rule is used on f(x) = x from 0 to 4. What does it give, with any number of pieces?

One Euler step for dv/dt = 10 - 0.5v, from v = 4 with dt = 0.2, gives what new v?

A force F = 3x newtons acts from x = 0 to x = 4 m. How much work does it do?

Which way of finding a slope from numbers has an error that is proportional to h squared?

The trapezoid rule with 20 pieces has an error of 0.01. About how large is the error with 40 pieces?

What does scipy.integrate.quad give?

Euler's method is first order. What does this mean for the error?

A ball moves in a plane, and its state is the position and the velocity. What must the rate function of solve_ivp return?

A student finds a derivative with the central difference and h equal to 1e-15, and the answer is wrong by a large amount. What is the reason?

All 20 practice questions on Calculus by Computer →

Worked problems

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

  • A trolley is at the positions 0, 3, 12, 27, 48 and 75 m at the times 0, 1, 2, 3, 4 and 5 s…Easy
  • The height of a ball is h(t) = 20t - 4.9t² metres…Medium
  • The area under sin x from 0 to π is exactly 2…Medium
  • A train's speed in m/s was measured at the times 0, 2, 5, 9, 10 and 12 s: 0, 6, 10, 10, 4 and 0…Medium
  • The standard normal curve is φ(z) = 1/(√(2π)) e^(-z²/2)…Medium
  • The force that is needed to stretch a stiff spring by x metres is F(x) = 50x + 200x³ newtons…Medium
  • A cup of tea at 90 degrees cools in a room at 20 degrees…Medium
  • A skydiver falls with the quadratic drag dv/dt = g - g/vt²v², where g = 9.8 m/s² and the terminal…Hard
  • The drag constant is k = (ρ Cd A)/2m, so for a ball of the same size and shape, it is inversely…Medium
  • With the drag constant k = 0.0089 per metre, find the best angle (whole degrees, from 20 to 70) for…Hard

Python labs

  • Derivative from numbers
  • Area under a curve
  • Integrals with quad
  • Euler's method
  • Euler against exact
  • Project: landing range

Related topics

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