Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [calculus]

Use this tag for challenges involving integration or differentiation of functions.

Filter by
Sorted by
Tagged with
26 votes
28 answers
2k views

Derivative of a product

In calculus, the derivative of a mathematical function defines the rate at which it changes. The derivative of a function f(x) can be marked as ...
user avatar
  • 27.6k
3 votes
3 answers
197 views

Plot Slope Fields Given Differential Equation

Slope fields or direction fields, are a graphical representation of the solutions to a first-order differential equation of a scalar function. A slope field shows the slope of a differential equation ...
user avatar
  • 447
8 votes
20 answers
767 views

Trapezoidal Riemann Sum

Given a list of coordinate pairs, output the Trapezoidal Riemann Sum of the values given between the first and last x-coordinates. You will be given a sorted list of coordinate pairs, like this: ...
user avatar
  • 27.6k
13 votes
12 answers
953 views

Definite integral of polynomial functions

You will need to evaluate the definite integral (bounded by \$a\$ and \$b\$) of a certain polynomial function that takes the form of: $$\int_a^b \left( k_n x^n + k_{n-1} x^{n-1} + \cdots + k_2x^2 + ...
user avatar
  • 447
12 votes
18 answers
1k views

Polynomial Laplace transform

This is a repost of this challenge, intended to revamp it for looser I/O formats and updated rules You are to write a program which takes an integer polynomial in \$t\$ as input and outputs the ...
user avatar
15 votes
5 answers
925 views

Solve a separable differential equation

A first order separable ordinary differential equation is (arguably) the easiest type of differential equation to solve, and takes the form of $$N(y)\frac{dy}{dx} = M(x) \\ y(x_0) = y_0$$ For two ...
user avatar
7 votes
6 answers
324 views

String-wise calculus (i)

This will turn into a series involving other aspects of calculus, including using the "derivative" of a string to find "stationary points" etc, as well as "integration" of sentences Introduction If ...
user avatar
  • 21k
8 votes
0 answers
475 views

Goldbach's Comet

Back to back challenges I guess. Hopefully this one is more clear than the last. Background I was playing around with Goldbach's conjecture, and decided to plot evens (on the x-axis) vs the number ...
user avatar
8 votes
6 answers
334 views

Simplify and Take Partial Derivative to a Polynomial String

Introduction Write a program to calculate the partial derivative of a polynomial (possibly multivariate) with respect to a variable. Challenge Derivatives are very important mathematical tools that ...
user avatar
  • 3,566
14 votes
11 answers
3k views

Find The Local Maxima And Minima

Definition The maxima and minima of a given function are the largest and smallest values of the function either within a given range or otherwise within the entire domain of the function. Challenge ...
user avatar
  • 4,920
18 votes
10 answers
2k views

Approximate definite integrals using Riemann sums

Left and right Riemann sums are approximations to definite integrals. Of course, in mathematics we need to be very accurate, so we aim to calculate them with a number of subdivisions that approaches ...
user avatar
  • 41.4k
6 votes
7 answers
470 views

It's a Slippery Slope

There has not been a challenge regarding slope fields, as a far as I can tell. So, I might as well make one. The challenge Given: A black box function f which ...
user avatar
  • 5,972
15 votes
10 answers
1k views

The Lehmer-Comtet sequence

The Lehmer-Comtet sequence is a sequence such that a(n) is the nth derivative of f(x) = xx with respect to x as evaluated at x = 1. Task Take a non-negative integer as input and output the nth term ...
user avatar
  • 85.1k
32 votes
40 answers
5k views

The Pedant's Cosine

My boss just told me to write a cosine function. Being a good math geek, my mind immediately conjured the appropriate Taylor Series. $$\cos(x) = \frac 1 {0!} - \frac {x^2} {2!} + \frac {x^4} {4!} - \...
user avatar
43 votes
6 answers
3k views

​P​i​ =​= ​3​.​2​

Inspired by this video of Infinite Series. Introduction Pi is defined as the ratio of the circumference to the diameter of a circle. But how is a circle defined? Usually a circle is defined as the ...
user avatar
  • 43k
14 votes
23 answers
1k views

Find the rate of change at a point on a polynomial

Given the equation of a polynomial and an x-coordinate find the rate of change of the point at that x-coord on the curve. A polynomial is in the form: axn + axn-1 + ... + ax1 + a, where a ϵ Q and n ϵ ...
user avatar
  • 6,557
15 votes
5 answers
1k views

Solve the Laplace equation

Introduction to Numerical Mathematics This is the "Hello, World!" of PDEs (Partial Differential Equations). The Laplace or Diffusion Equation appears often in Physics, for example Heat ...
user avatar
  • 4,333
5 votes
16 answers
941 views

Write a Sine-Deriving Machine

The Challenge Your challenge is to write a program that evaluates the following function: f(x, t) = d^x / dt^x (sin t) That is, the x-th derivative of sin t. In case you aren't familiar with ...
user avatar
  • 873
8 votes
1 answer
371 views

Approximate the Fransén-Robinson constant

Given an input n, output the value of the Fransén-Robinson constant with n digits after the decimal place, with rounding. Rules ...
user avatar
4 votes
3 answers
197 views

Taylor Series of a Function with Periodic Derivatives

Taylor series are a very useful tool in calculating values of analytic functions that cannot be expressed in terms of elementary functions, using only information about that function at a single point....
user avatar
  • 25.5k
11 votes
3 answers
3k views

Evaluate the Riemann Zeta Function at a Complex Number

Introduction I found this question that was closed because it was unclear, yet it was a nice idea. I'll do my best to make this into a clear challenge. The Riemann Zeta function is a special function ...
user avatar
  • 1,536
4 votes
3 answers
131 views

Symbolic Differentiation of Composed Functions

Symbolic Differentiation 2: Back on the Chain Gang Task Write a program that takes in a certain sort of function from stdin and differentiates it with respect to x, using the chain rule.* The input ...
user avatar
2 votes
1 answer
241 views

Build a Calculus Interpreter I [closed]

A struggling manufacturer named Tennessee Instrumental is desperate to get into the calculator business. Problem is, they don't have any software engineers on payroll, and the deadline is coming up ...
user avatar
  • 489
25 votes
9 answers
3k views

Approximate ∫((e^x)/(x^x))dx

You are to approximate the value of: Where your input is I. Rules You may not use any built-in integral functions. You may not use any built-in infinite ...
user avatar
16 votes
1 answer
391 views

Do the Chain Rule

We've had a lot of challenges on differentiation and integration, but none on just solving related rates problems. So in this challenge, you will get a bunch of derivatives (They will be numeric, not ...
user avatar
  • 25.5k
21 votes
2 answers
864 views

Symbolic Integration of Polynomials

Apply an indefinite integral to a given string. The only rules you will be using are defined as such: ∫cx^(n)dx = (c/(n+1))x^(n+1) + C, n ≠ -1 c, C, and n are all constants. Specifications: You ...
user avatar
22 votes
12 answers
2k views

Gamma Function Golf

Given a real number t in (-10^9,13) (not including -10^9 or ...
user avatar
21 votes
12 answers
2k views

Symbolic Differentiation of Polynomials

Symbolic Differentiation 1: Gone Coefishin' Task Write a program that takes in a polynomial in x from stdin (1 < deg(p) < 128) and differentiates it. The input polynomial will be a string of ...
user avatar
7 votes
1 answer
565 views

Evaluate CDF of Student-t distribution

The goal of this codegolf is evaluating the cumulative distribution function of the student-t probability distribution. This is not trivial since there is no closed form and the function is dependent ...
user avatar
  • 43k
53 votes
9 answers
4k views

Help me with differential calculus!

I love programming and know every language, but I suck at math. Unfortunately, my school requires that computers students must take a year of calculus. There's a test next week, and I don't know any ...
user avatar
  • 10.8k
5 votes
5 answers
596 views

Build the blancmange function

The blancmange function is used as an example in basic calculus of a function that is continuous everywhere, but differentiable nowhere. It achieves this effect by using the sums of ever-diminishing ...
user avatar
  • 33.7k
6 votes
2 answers
4k views

Determine stability of a system using the Routh-Hurwitz stability criterion

The Routh-Hurwitz is a criteria which serves to prove or disprove the stability of an electric control system. Idea Given a system which has an equation of the form ...
user avatar
  • 291
6 votes
1 answer
246 views

Numerical Integration through Plotting

Inspired by this on Spiked Math: (source: spikedmath.com) In this code golf, you are going to write a numerical integrator. Instead of weighting, you first plot on a graphic canvas pixel-by-pixel ...
user avatar
  • 5,801