Why Can't You Solve an Equation by Differentiating Both Sides?

Squaring both sides keeps every original solution, but differentiating does not. The difference comes from the type of the function you apply.

Differentiation compares how functions change on an interval. Solving f(x)=g(x)f(x)=g(x) asks where their values agree. Agreement at a point does not imply agreement of derivatives there.

For example,

x2=4xx{0,4}.x^2=4x\quad\Longleftrightarrow\quad x\in\{0,4\}.

Differentiating the expressions produces 2x=42x=4, whose solution is x=2x=2. Neither original solution survives, and the new solution does not satisfy the original equation. The derivative equation finds where the two graphs have equal slopes, not where they intersect.

An identity is different from a pointwise equation

If differentiable functions ff and gg satisfy f(x)=g(x)f(x)=g(x) for every xx in an open interval II, then f=gf'=g' on II. This follows by applying the derivative definition to an identity that holds at neighboring points.

The converse loses a constant. If f=gf'=g' throughout II, the mean value theorem gives fg=Cf-g=C on that interval. One additional equality, such as f(x0)=g(x0)f(x_0)=g(x_0), forces C=0C=0.

In functional notation, differentiation is the map

D:C1(I)C0(I),Df=f.D:C^1(I)\longrightarrow C^0(I),\qquad Df=f'.

It is not injective because functions differing by a constant have the same derivative. But noninjectivity is only part of the explanation: in an ordinary equation such as x2=4xx^2=4x, we never had an identity on an interval to differentiate in the first place. Restricting attention to a few solution points does not turn the original expressions into such an identity.

When transforming an equation is legitimate

Applying a function TT to both sides of a value equality always preserves the forward implication:

a=bT(a)=T(b).a=b\quad\Longrightarrow\quad T(a)=T(b).

The converse holds if TT is injective on the relevant values. Squaring, for example, can introduce extra solutions when opposite signs are possible. Differentiation is an operation on functions, so this reasoning applies to equalities between functions; it cannot justify differentiating a condition imposed only at an unknown point.

Differentiating an integral equation

Sometimes an unknown is a whole function, and differentiation is useful. Suppose yy is continuous and

y(t)=1+0ty(s)dsy(t)=1+\int_0^t y(s)\,ds

for every tt in an interval containing zero. The fundamental theorem of calculus gives

y(t)=y(t),y(0)=1.y'(t)=y(t),\qquad y(0)=1.

Conversely, integrating y=yy'=y and using y(0)=1y(0)=1 recovers the original integral equation. The differential equation alone admits y(t)=Cety(t)=Ce^t; the initial condition selects C=1C=1.

The useful procedure is to establish both directions and track the information differentiation removes. It is not a general method for replacing an algebraic equation by the equality of its derivatives.