Starlight Tools

Derivative Calculator with Free Steps and Graph

Calculate first through fifth derivatives, evaluate at an exact point, or find a tangent line with free steps and an interactive graph. The default solver handles explicit single-variable real functions; separate partial and implicit modes support the cases described below.

Enter a function

Solver mode

Explicit single-variable functions. All trigonometric arguments use radians.

Parsed expression
Math keypad & input help

Use ^ for powers and * or implicit multiplication. ln(x) is natural log; log(x) is base 10; log(x,2) has base 2. Try cbrt(x), root(x,5), arcsin(x), sin^2(x), π or ½. Write x*y for separate variables. Put denominators in parentheses: 1/(2x).

Keys insert into the last focused expression or point field, at its cursor or selection.

Keyboard shortcut: Ctrl/⌘ + Enter.

Derivative

Original function
Enter a function to begin.
First derivative
The exact derivative will appear here.

Formulas apply only where the original function and required derivatives exist. Domain handling and limitations.

Numerical verification

Step-by-step differentiation

Rule-by-rule working will appear here.

Function and derivative graph

Drag horizontally to pan. Tap to inspect; use the buttons to zoom. Vertical scale fits the visible curves.

Differentiate a function to draw both curves. Gaps indicate undefined or non-real values.

Tap the graph to inspect coordinates.

Accessible graph sample values
Visible interval, evenly spaced samples
Inputff′Tangent

Methodology, tests and limitations

Maintained by Starlight Robotics. Review status: automated regression checks; independent mathematics review has not been documented.

Validation revision: . This revision covers parsing, symbolic rules, exact point substitution, algebraic simplification, real-domain guards and numerical comparisons. The reproducible suite contains 51 tests, including 600 comparisons between raw and simplified derivatives. See the published supported-expression cases.

  1. Parse the expression into a tree without evaluating executable code.
  2. Differentiate using symbolic rules, then combine terms, factor common factors and cancel matching integer powers. Rational coefficients remain fractions.
  3. Compare each derivative with central finite differences of the preceding expression at eight sample inputs, using h = 10⁻⁴ max(1, |x|) and h/2. Both estimates must agree within 2 × 10⁻⁵ max(1, |symbolic|, |estimate|).

Verified means at least three samples passed for every requested order with no stable mismatch. Domain failures are skipped; unstable estimates are inconclusive. This is a numerical spot check, not proof of an identity or of differentiability everywhere. Partial checks fix other variables to disclosed sample constants. Implicit checks test Fₓ and Fᵧ separately, not solution branches of the equation.

Real domains: denominators must be nonzero; logarithm arguments positive; log bases positive and not 1; even roots nonnegative (their derivative may require a positive argument); asin/acos derivatives require |argument| < 1. Odd roots accept negative inputs. General variable powers use the positive-base logarithmic rule. Original expressions and unsimplified derivative stages are checked before point values or graph samples, retaining exclusions after cancellation.

Known limits: no complex numbers, piecewise syntax, mixed partials, differential equations, automatic domain solving, branch solving or limits at singularities. Root and absolute-value compositions can be differentiable where the rule formula is singular; the calculator conservatively declines those points. Some equivalent identities and common-denominator sums remain unsimplified. High-order expressions have a complexity limit. Floating-point underflow, overflow and narrow features can affect numerical checks and graphs. Maximum input: 300 characters; orders: 1–5. Implicit mode returns first-order dy/dx only, where Fᵧ ≠ 0.

Calculation runs on your device. Copying a permalink includes your expression in its URL; opening that link sends the URL to the website. Math typesetting is loaded from a third-party CDN.

Supported-expression test set and expected derivatives
InputExpected result / condition
4x^3-5x+712x² − 5
x^3*sin(x)x²(3 sin x + x cos x)
(x^2+1)/(x-1)(x² − 2x − 1)/(x − 1)²; x ≠ 1
ln(x^2+1)2x/(x² + 1)
e^(2x), 2^x, x^x2e²ˣ; 2ˣ ln 2; xˣ(ln x + 1), x > 0
sin^2(x), arcsin(x)2 sin x cos x; 1/√(1 − x²), |x| < 1
cbrt(x), root(x,5)1/(3 cbrt(x)²); 1/(5 root(x,5)⁴), x ≠ 0
log(x,2), log(x)1/(x ln 2); 1/(x ln 10), x > 0
½×x², 1⁄3*x^3x; x²
x^5, order 5120
sin(x) at pi/2f(a) = 1, slope = 0, tangent y = 1
x^2*y+sin(y), ∂/∂x2xy, holding y constant
x^2+y^2=25dy/dx = −x/y, y ≠ 0
abs(x) at 0; x/x at 0Point values rejected

Report an error — include your expression, mode, variable, order, point and expected answer.

What is a derivative?

A derivative measures an instantaneous rate of change. Geometrically, f′(a) is the slope of the tangent line to y = f(x) at (a, f(a)). It is defined when this finite, two-sided limit exists:

\[f'(x)=\lim_{h\to0}\frac{f(x+h)-f(x)}{h}.\]

The first derivative describes change: position gives velocity, cost gives marginal cost, and population gives a growth rate. A positive derivative indicates local increase and a negative derivative local decrease.

The second derivative measures how that rate changes: position gives acceleration and its sign describes concavity. Optimization uses stationary points (f′ = 0), boundaries and domain checks; a zero derivative alone does not prove a maximum or minimum.

The third derivative measures change in acceleration (jerk for motion). Higher derivatives continue this process and help describe local behavior and Taylor approximations.

How to use the derivative calculator

  1. Enter a function such as x^3*sin(x), ln(x^2+1), or e^(2x).
  2. Select the variable and choose a derivative order from first through fifth.
  3. Choose Evaluate at a Point or Tangent Line and enter a constant expression such as pi/2. These modes use the first derivative; Differentiate can also evaluate a selected higher order.
  4. Select the primary solve button, then review the result, verification samples and derivation. Partial mode holds other single-letter variables constant; implicit mode accepts an equation in x and y.

Multiplication may be explicit or implicit: 2*x, 2x, and 3(x+1) are accepted. Function names require parentheses, such as sin(x). Trigonometric inputs use radians.

Derivative formula reference

Here u and v are differentiable functions of x; primes mean differentiation with respect to x. Each example button loads the matching rule.

Rules, real-domain conditions and examples
RuleFormulaConditions / try it
Constant
\((c)'=0\)
c constant
Constant multiple
\((cu)'=cu'\)
c constant
Sum / difference
\((u\pm v)'=u'\pm v'\)
u and v differentiable
Power
\((u^n)'=nu^{n-1}u'\)
n constant; real power domain
Product
\((uv)'=u' v+uv'\)
Both factors differentiable
Quotient
\(\left(\frac{u}{v}\right)'=\frac{u' v-uv'}{v^2}\)
v ≠ 0
Chain
\((g(u))'=g'(u)u'\)
Both functions differentiable
Exponential
\((e^u)'=e^u u',\quad(a^x)'=a^x\ln a\)
a > 0
Logarithmic
\((\ln u)'=\frac{u'}{u},\quad(\log_b u)'=\frac{u'}{u\ln b}\)
u > 0; constant b > 0, b ≠ 1
Sine / cosine
\((\sin u)'=\cos(u)u',\quad(\cos u)'=-\sin(u)u'\)
Radians
Tangent / cotangent
\((\tan u)'=\sec^2(u)u',\quad(\cot u)'=-\csc^2(u)u'\)
cos u ≠ 0 for tan; sin u ≠ 0 for cot
Secant / cosecant
\((\sec u)'=\sec(u)\tan(u)u',\quad(\csc u)'=-\csc(u)\cot(u)u'\)
cos u ≠ 0 for sec; sin u ≠ 0 for csc
Inverse sine / cosine
\((\arcsin u)'=\frac{u'}{\sqrt{1-u^2}},\quad(\arccos u)'=-\frac{u'}{\sqrt{1-u^2}}\)
|u| < 1 for these formulas
Inverse tangent
\((\arctan u)'=\frac{u'}{1+u^2}\)
Real u
Hyperbolic
\((\sinh u)'=\cosh(u)u',\quad(\cosh u)'=\sinh(u)u'\)
Real u
Hyperbolic tangent / secant
\((\tanh u)'=\operatorname{sech}^2(u)u',\quad(\operatorname{sech}u)'=-\operatorname{sech}(u)\tanh(u)u'\)
Real u
Roots
\((\sqrt[n]{u})'=\frac{u'}{n(\sqrt[n]{u})^{n-1}}\)
Integer n ≥ 2; nonzero root; even n requires u > 0
Absolute value
\((|u|)'=\frac{u}{|u|}u'\)
Formula requires u ≠ 0

Complete worked derivative examples

Polynomial

f(x) = 4x^3-5x+7

\[4(3x^2)-5(1)+0=12x^2-5\]

Linearity and power rule. Differentiate each term: d(x³)/dx = 3x², d(x)/dx = 1 and d(7)/dx = 0.

Domain: All real x.

Product

f(x) = x^3*sin(x)

\[u=x^3,\ v=\sin x,\ u'=3x^2,\ v'=\cos x\]

Product rule: u′v + uv′ = 3x² sin x + x³ cos x = x²(3 sin x + x cos x).

Domain: All real x.

Quotient

f(x) = (x^2+1)/(x-1)

\[u=x^2+1,\ v=x-1,\ u'=2x,\ v'=1\]

Quotient rule: (u′v − uv′)/v² = [2x(x − 1) − (x² + 1)]/(x − 1)² = (x² − 2x − 1)/(x − 1)².

Domain: x ≠ 1.

Nested chain

f(x) = sin((x^2+1)^3)

\[u=x^2+1,\ v=u^3,\ u'=2x,\ v'=3u^2(2x)\]

Outer sine gives cos(v); multiply by v′ to obtain 6x(x² + 1)² cos((x² + 1)³).

Domain: All real x.

Trigonometric composition

f(x) = sin(x^2)

\[u=x^2,\ u'=2x,\ (\sin u)'=\cos(u)u'\]

Chain rule gives f′(x) = 2x cos(x²).

Domain: All real x; radians.

Natural logarithm

f(x) = ln(x^2+1)

\[u=x^2+1,\ u'=2x,\ f'=\frac{u'}{u}=\frac{2x}{x^2+1}\]

Logarithm and chain rules: divide the inner derivative by the inner expression.

Domain: All real x because x² + 1 > 0.

Exponential composition

f(x) = e^(2x)

\[u=2x,\ u'=2,\ f'=e^u u'=2e^{2x}\]

Exponential and chain rules: retain e to the inner power, then multiply by the inner derivative.

Domain: All real x.

Constant base aˣ

f(x) = 2^x

\[2^x=e^{x\ln2},\quad f'=2^x\ln2\]

Write aˣ = e^(x ln a). Its inner derivative is ln a, so d(aˣ)/dx = aˣ ln a. Here a = 2.

Domain: All real x for a > 0.

Variable base and exponent

f(x) = x^x

\[\ln f=x\ln x,\quad\frac{f'}{f}=\ln x+1,\quad f'=x^x(\ln x+1)\]

Logarithmic differentiation: the product rule differentiates x ln x; multiply by f = xˣ.

Domain: x > 0 for this real logarithmic derivation.

Second derivative

f(x) = x^4-3x^2

\[f'=4x^3-6x,\quad f''=12x^2-6\]

Apply the power rule to each term, then repeat it on 4x³ − 6x.

Domain: All real x.

Exact point evaluation

f(x) = sin(x)

\[a=\frac{\pi}{2},\quad f(a)=1,\quad f'(a)=\cos\frac{\pi}{2}=0\]

Differentiate first, then substitute the exact point. The point is (π/2, 1), with slope 0 and horizontal tangent y = 1.

Domain: All real x; radians.

Tangent line

f(x) = x^2

\[a=\frac13,\quad f(a)=\frac19,\quad f'(a)=\frac23,\quad y=\frac19+\frac23\left(x-\frac13\right)\]

Power rule gives 2x. Substitute a = 1/3 into f and f′, then use y = f(a) + f′(a)(x − a). Equivalently y = 2x/3 − 1/9.

Domain: All real x.

Derivative calculator FAQs

What does a derivative mean?

A derivative is an instantaneous rate of change and, when finite, the slope of a tangent line. For position as a function of time, the first derivative is velocity.

How do I find f′(a)?

Differentiate f(x), then substitute a into the derivative. Evaluate at a Point accepts exact constant expressions such as pi/2, 1/3 and sqrt(2). It also shows f(a), the tangent point and the tangent line when defined.

How is a tangent-line equation formed?

At a differentiable point a, use y = f(a) + f′(a)(x − a). The line passes through (a, f(a)) and has slope f′(a). A zero slope gives a horizontal tangent; a vertical tangent has no finite slope in this form.

What is the difference between ln and log?

ln(x) is the natural logarithm, with base e. log(x) uses base 10. log(x,b) uses the specified constant base b, which must be positive and different from 1. All real logarithm arguments must be positive.

Why can equivalent derivative answers look different?

Expansion, factoring, cancellation and identities can produce different-looking versions of the same expression. This solver combines terms and common factors but does not find every identity. Cancelled factors retain the original domain restrictions. Numerical verification is a spot check, not proof of equivalence everywhere.

When does a derivative not exist?

A finite derivative may fail at a corner such as abs(x) at 0, a cusp, a discontinuity, a vertical tangent or a point outside the function’s domain. A singular rule formula can also require a separate limit calculation; this solver conservatively declines those points.

What do higher derivatives mean?

The second derivative is the rate of change of the first derivative, and the third is the rate of change of the second. For motion they describe acceleration and jerk. Choose orders one through five; each stage has its own derivation.

Are partial and implicit derivatives supported?

Yes, in separate modes. Partial mode differentiates with respect to the selected single-letter variable and holds the others constant; repeated derivatives use that same variable. Implicit mode accepts one equation in x and y and returns dy/dx = −Fₓ/Fᵧ where Fᵧ is nonzero. It does not solve branches, mixed partials or differential equations. Point values and graphs are available for explicit single-variable functions.

How do I enter multiplication, roots and trigonometry?

Use * or implicit multiplication, ^ for powers, sqrt(x), cbrt(x) or root(x,n). sin^2(x), arcsin/arccos/arctan aliases and Unicode fractions are accepted. Function names need parentheses and trigonometric inputs use radians. Write x*y for separate variables and 1/(2x) for a grouped denominator.

Why can the graph have gaps?

Samples are omitted where the original function or required derivative formulas are undefined or non-real. A graph is a finite sample and may miss narrow features or discontinuities; it is not a domain proof.

Does my expression leave the browser?

Parsing, differentiation, simplification and graphing run locally. A copied permalink contains the input in its URL, and opening it sends that URL to the website. Typesetting loads from a third-party CDN.

Explore more mathematical tools

Explore more tools