# Differentiating both sides of an equation

1. Feb 19, 2008

### awvvu

When is it valid to differentiate both sides of an equation? I was working on a physics problem and came across this, where I had to solve for p(r).

$$q(r) = \int_0^r \rho(s) * 4 \pi s^2 ds = \frac{Q r^6}{R^6}$$

So, differentiating both sides with respect to r and using the Fundamental Theorem:

$$\rho(r) * 4 \pi r^2 = \frac{6 Q r^5}{R^6}$$

Solving for p(r), I get the right answer, so obviously this is what they expect me to do. What I'm wondering is why exactly is this valid, when this is not:

$$x^2 = x => x = 1$$

Differentiating both sides:

$$2 x = 1 => x = \frac{1}{2}$$

I think I came up with the gist of an explanation while typing this post up... but I'd really like a clear and more rigorous way to explain it. x^2 = x is only true for x = 1, so you can't differentiate both sides. But for my first equation, I assume that there is a p(r) that makes both sides of the equation true for all r. So, I can solve for this p(r). Am I right?

Last edited: Feb 19, 2008
2. Feb 19, 2008

### Mute

The problem with your second equation is that it isn't one, at least in the same sense as your first equation. It uniquely determines what x is. Hence, x isn't really a variable - you know what it is - it's 1. It doesn't make sense to differentiate that expression then because x really isn't a variable in it.

In your first expression, you really do have a functional relationship between the integral and the other expression - it holds for any value of r. As a result, r is a variable and the expression can be differentiated on both sides of the equality.

So basically, the explanation you came up with was correct.

Last edited: Feb 19, 2008
3. Feb 19, 2008

### awvvu

Okay, thanks.