# When is differentiating an equation valid?

I wonder that Is it true to differentiate an equation side by side. Under which conditions can I differentiate both sides. For example, for the simple equality $x=3$, Is ıt valid to differentiate both sides with respect to x. I know that I am missing some basic point but I cant find it. Thanks for your helps.

• What is your question? Jan 8 '15 at 11:34
• Is it valid to differentiate both sides of the equality $x=3$ with respect to x. Jan 8 '15 at 11:35
• yes it is valid Jan 8 '15 at 11:36
• but then $1=0$ comes. Jan 8 '15 at 11:37
• if two things are equal then they're the same thing, clearly doing something to one of them must be equivalent to doing it to the other one (because you're claiming they're the same thing)... Jan 8 '15 at 15:50

Without getting into the details of the definition of function, let us just note that the two most important underlying concepts in the concept of function are its domain and its assignment rule (with a bucket of salt).

To say that two functions $f,g$ are equal is to say that the assignment rule is the same and that the domains are the same.

Differentiating is something that you do to functions, so when you talk about 'differentiating $x=3$' this can only make sense if you look at it as meaning 'differentiating both sides of the equality $f=g$ where $f\colon A\to \mathbb R, x\mapsto x$ and $g\colon A\to \mathbb R, x\mapsto 3$, for some set open set $A$'. Note that $f=g$ means $\forall x\in A(f(x)=g(x))$

Now you can differentiate both sides of $f=g$ to obtain $f'=g'$ or $\forall x\in A(1=0)$.

There is no contradiction here because the initial assumption $f=g$ is false, it is not true that $\forall x\in A(f(x)=g(x))$. (Note that $A$ is open so this excludes the possbility of $A=\{3\}$).

• I knew differentiating functions to some point and I used to differentiate equations side by side, mostly in taylor expansions of functions. When one of my friend asked me the differentiation of $x=3$, the result astonished me. Now I understand the significany of interval in such questions. Thanks for your answer. Jan 8 '15 at 12:24
• @guest You're welcome. Jan 8 '15 at 12:25
• Comment, down voter? Oct 12 '15 at 15:12
• @Git Gud I am not the down voter but what about the functions $f(x)=sin \pi x$ and $g(x)= 0$ where the domain of both functions is restricted to integers. Why diiferentiating does not preserve equality? Mar 14 '18 at 16:05
• @Fermat I actually addressed this in my answer, somewhat in disguise. If you restrict to $\mathbb Z$, then you're dealing with a closed set (in $\mathbb R$). You need an open set to differentiate (even if that set is a subset of the domain), but $\mathbb Z$ doesn't contain any open set (apart from $\varnothing$). Mar 14 '18 at 23:58

If you are given that for all $x$, $f(x)=g(x)$, then the two functions are equal, and so their derivatives must be as well. Therefore, $f'(x)=g'(x)$ for all $x$.

On the other hand, if you are trying to find a solution to $f(x)=g(x)$, differentiating may not retain truth. Consider, for all $x$, $f(x)=2$ and $g(x)=1$. Clearly, $f(x)=g(x)$ has no solutions, but $f'(x)=g'(x)$ has infinitely many solutions.

In your example, $x=3$, the equation is not true for all $x$. It is true for only one $x$, that is, $3$. Because of this, differentiating both sides can lead to a false statement.

• Thanks for your answer. In general, in equalities, I was taking derivative of both sides preserving the equal sign without looking the interval. But according to your answer I understand that there should be an interval for the equation so that I can derive both sides on that interval. Did I understand truely? Jan 8 '15 at 11:51
• @guest: If I understand you correctly, yes. I think Git Gud's comment explains it very elegantly. Jan 8 '15 at 12:00
• Git Gud has removed their comment, so here is their answer instead. Jan 8 '15 at 12:32
• @Regret If we look at the function x²+y²=25, doesn't it fall in the same category as x=3? I mean, if we look at the two sides as functions (say f and g), it's not true that f(x,y)=g(x,y) for all x,y. Then couldn't differentiating both sides of it lead to a false statement? Please let me know if I need to open a new question for this. Thanks Mar 2 '17 at 3:27
• @Sasaki: You are correct. In your example, $\nabla f(x, y) = (2x, 2y)$ and $\nabla g(x, y) = (0, 0)$. Then, the equation $\nabla f(x,y) = \nabla g(x,y)$ is only true when $x=y=0$. (The upside down triangle $\nabla$ is the nabla operator, a type of derivative) Mar 3 '17 at 10:15