Differentiability Calculator

Compare left and right derivatives at a point to detect corners, cusps, and vertical tangents.

Differentiability Calculator

What Does Differentiable Mean?

A function is differentiable at a point when the limit defining the derivative exists there:

f′(c) = limh→0 [f(c + h) − f(c)] / h

and existence of a two-sided limit means both one-sided versions exist and agree. Geometrically, the graph has a single, non-vertical tangent line at the point: zoom in far enough and the curve becomes indistinguishable from a line. The interesting failures each have a name and a shape: a corner (one-sided slopes exist but differ, like |x| at 0), a cusp (slopes blow up to opposite infinities, like √|x| at 0), a vertical tangent (both blow up the same way, like x1/3 at 0), and any discontinuity (differentiability is impossible without continuity). This calculator computes both one-sided difference quotients with shrinking steps, classifies the point, and draws the one-sided tangent lines so the geometry is visible.

How to Use the Differentiability Calculator

Enter a function and a test point. The steps first check continuity at the point (a failed check ends the analysis, since discontinuous means non-differentiable automatically), then evaluate the left and right difference quotients at h = 10⁻² down to 10⁻⁶, watching where they settle or explode. The verdict names the behavior, differentiable with the derivative's value, corner with both slopes, cusp, or vertical tangent, and the graph overlays the one-sided tangents in different colors: at a smooth point they merge into one line; at a corner they visibly disagree.

Worked Example

Test |x| at 0. From the right, [|h| − 0]/h = h/h = 1 for every positive h; from the left, |−h|/(−h) = −1. The two one-sided derivatives are

D⁺ = +1  and  D⁻ = −1

Both exist, but they disagree: a textbook corner. There is no single tangent line, only a left tangent of slope −1 and a right tangent of slope +1, and the derivative simply does not exist at 0 even though |x| is continuous everywhere. Compare the x|x| chip: the absolute value inside would suggest trouble, yet both one-sided slopes at 0 equal 0, so the function is differentiable there, its graph is two parabola halves welded smoothly. The presence of |·| in a formula does not decide anything; the limits do.

Continuity versus Differentiability

Differentiability implies continuity: if the difference quotient converges, the numerator f(c + h) − f(c) must vanish as h → 0, which is continuity. The converse fails, and fails spectacularly. |x| shows one bad point; Weierstrass's famous 1872 construction showed a function continuous everywhere and differentiable nowhere, an infinite crinkle of corners at every scale that scandalized the mathematicians of the day and prefigured fractals. Brownian motion's paths behave the same way, which is why stochastic calculus needed new foundations. The practical moral: smoothness is strictly stronger than unbrokenness, and each degree of smoothness (once, twice, infinitely differentiable) is a genuine upgrade that must be checked, not assumed. The discontinuity calculator handles the continuity layer; this page handles the next one up.

Common Mistakes to Avoid

  • Concluding non-differentiability from the formula's looks. x·|x| and |x|³ are differentiable at 0 despite the absolute values; x²sin(1/x) (extended by 0) is differentiable at 0 despite wild oscillation. Only the limit decides.
  • Confusing corners with cusps. Corners have finite, unequal one-sided slopes; cusps have infinite ones of opposite sign, a genuinely sharper point. The tool distinguishes them because their calculus consequences differ.
  • Forgetting vertical tangents. x1/3 at 0 is continuous with a perfectly smooth-looking graph, yet not differentiable: the tangent exists but is vertical, and slope "infinity" is not a real number.
  • Testing differentiability at a discontinuity. It can never succeed; continuity is a prerequisite. Check it first, as the tool does, before interpreting difference quotients.
  • Trusting one small h. A single difference quotient at h = 0.001 can look settled while the true limit diverges. The tool tracks a whole shrinking sequence and demands stabilization before declaring a slope.

Real-World Applications

Non-differentiable points are where physical and computational systems change regime. Optimization algorithms care intensely: gradient descent assumes a gradient, and modern machine learning runs on functions with corners built in, ReLU(x) = max(0, x) is exactly the |x|-style corner, handled by subgradients rather than derivatives. Mechanics meets corners at impacts and cusps in caustics of light; the path of a reflected wavefront can carry cusp singularities that concentrate energy. Signal processing reads sharp features as high-frequency content: a corner in a signal costs a slowly decaying Fourier tail. In economics, kinked demand curves and tax-bracket boundaries make marginal analysis one-sided, precisely the D⁺ versus D⁻ distinction this tool computes. And in numerical practice, detecting a corner tells an adaptive integrator or ODE solver to split the domain there, restoring the smoothness its error estimates assume. See also the derivative at a point calculator for the smooth case done symbolically.

Frequently Asked Questions

What exactly is checked to decide differentiability?

Three layers: f must be defined and continuous at the point; both one-sided difference quotients must converge as h shrinks; and their limits must agree. Passing all three yields the derivative; the specific failure mode determines the classification (corner, cusp, vertical tangent, or discontinuity).

Why does differentiability require continuity first?

The difference quotient has f(c + h) − f(c) in its numerator. For the quotient to converge while h → 0, the numerator must also go to 0, which is precisely continuity at c. A jump makes the quotient blow up like (gap)/h, so no derivative can exist.

What is the difference between a corner and a cusp?

At a corner the two one-sided slopes are finite but unequal (|x|: −1 and +1). At a cusp both one-sided slopes are infinite with opposite signs (√|x|: −∞ and +∞), so the graph comes to a needle point. Cusps are "sharper," and the tangent line fails in a stronger way.

Is a vertical tangent differentiable?

No. At x1/3's origin both one-sided quotients diverge to +∞ together: a well-defined tangent line exists geometrically, but it is vertical, and "slope = ∞" is not a value the derivative can take. The function is continuous, even invertible, yet f′(0) does not exist.

Can a function with absolute values still be differentiable?

Yes, whenever the pieces meet with matching slopes. x·|x| equals x² on the right and −x² on the left; both have slope 0 at the junction, so the weld is smooth. The rule of thumb: |g(x)| creates trouble only at zeros of g where g crosses with nonzero slope.

What do the two colored lines on the graph represent?

The one-sided tangent lines: teal built from the left-hand slope, red from the right-hand slope, each drawn only on its own side. At a differentiable point they align into a single straight line; at a corner they form a visible kink. It is the classification made pictorial.

How can a function be continuous everywhere but differentiable nowhere?

By stacking corners at every scale: Weierstrass summed cosines of rapidly increasing frequency and geometrically decreasing amplitude, so zooming in never straightens the graph. Such functions are the rule rather than the exception among continuous functions, and Brownian motion paths realize them physically.

Why does machine learning use non-differentiable functions like ReLU?

The corner at 0 is harmless in practice: away from it the function is linear and cheap, and at the corner a subgradient (any slope between the one-sided values) suffices for descent methods. The corner even helps, creating the sparsity and piecewise-linear structure deep networks exploit.

Does differentiability at a point say anything about nearby points?

Nothing at all. A function can be differentiable at exactly one point and discontinuous everywhere else (x² times the rational-indicator function is the standard example). Differentiability is a purely local, single-point property; smoothness on an interval is a stronger claim.

How reliable is the numerical test compared with symbolic analysis?

The shrinking-quotient test with stabilization checks matches hand analysis on the standard function classes and correctly flags corners, cusps, and vertical tangents. Exotic constructions (oscillations tuned to the sample scale) can fool any finite sampling; for those, symbolic one-sided limits are the arbiter, and the tool's step table shows exactly what the numerics saw.