Trading Dev AcademyFree quant education

Free lesson · Differential calculus

Core derivative rules: constants, powers and sums

Open interactive lessonPractice calculationsExplore labs

Start with the idea

  • A derivative is a local slope.
  • Start with one constant, one power and one sum before combining functions.
Symbols, units & horizon
  • x: dimensionless input in this example
  • f(x): dimensionless output
  • f′(x): output change per input change locally
  • d/dx: differentiate with respect to x
  • n: positive integer power
  • a: constant multiplier
  • g: another differentiable function
  • h: nonzero input increment before the limit

When and why to use this

Use these rules to differentiate a simple cost curve or loss function before tackling product, quotient and chain rules.

  • Constant rule: ddx7=0. The output never changes.
  • Identity rule: ddxx=1. Output and input change equally.
  • Power rule: ddxxn=nxn−1 for positive integer n.
  • Constant multiple: (af)′=af′ when a is fixed.
  • Sum rule: (f+g)′=f′+g′.
  • Apply each rule to one term. Leave products and nested functions for the next lesson.
f(x)=3x2+2x+7,f′(x)=6x+2
Core rule · definition and worked arithmetic

Core derivative rules: constants, powers and sums

  1. Constant: the change quotient is (7−7)h=0. Identity: ((x+h)−x)h=1.
  2. Square: expand ((x+h)2−x2)h=2x+h; its limit is 2x.
  3. For a positive integer power, the binomial expansion starts (x+h)n=xn+nxn−1h+⋯. Higher terms contain at least h²; after dividing by h they tend to zero.
  4. Split the change quotient of a sum into separate quotients; fixed multipliers can be taken outside the limit.
  5. Apply these rules: 3(2x)+2(1)+0=6x+2.
Work it by hand

At x=2, the derivative is 6×2+2=14. The function value is 3×4+4+7=23; value and slope are different quantities.

Use the rule

  • Name the inputs and units.
  • Work the small example by hand.
  • Check the result before continuing to the next lesson.

Before moving on

Explain the core rule in one sentence, reproduce the worked calculation and solve both practice variations.

Further reading: OpenStax · Differentiation rules · textbook checked 12 September 2026 ↗

Python implementation

Self-contained teaching example. Python 3.10+; dependencies and input conventions are shown in the code and notation. Run in your own Python environment.

def polynomial(x): return 3*x*x+2*x+7

def polynomial_derivative(x): return 6*x+2

def positive_integer_power_derivative(x, n):
    if not isinstance(n,int) or n < 1: raise ValueError("Positive integer power required")
    return n*x**(n-1)

print(polynomial(2), polynomial_derivative(2))

Continue learning

Differential Calculus: Limits & Derivatives — all lessons
  1. Start with a straight line: input, output and slope
  2. Functions, limits and continuity
  3. The derivative: from an average slope to an instantaneous rate
  4. Core derivative rules: constants, powers and sums
  5. Derivative rules: powers, products, quotients and compositions
  6. Second derivatives, Taylor expansions and numerical error
  7. Stationary points, optimisation and Newton’s method

Quantitative finance and development glossary · Python resources and libraries · Research sources and limitations