When can you take the derivative of both sides of an equation? I know in general you cannot take the derivative of an equation to solve it because the derivative at a point depends on neighboring points of a function. 

However, lots of the proofs done in my probability course, for example finding the variance of a geometric random variable is done by differentiating both sides. Why is this allowed?
considering the equation
$$x^3 = x + 6$$
here $x=2$ is the solution of differential equation
but if we differentiate both sides of equation then we get
$$3x^2 = 1$$
in this case $x=2$ gives $12=1$
not satisfied
this means that two functions are just interesect not tangent to each other
If these function are actually equal then we can differenctiate both sides
For more geometric perspective the arithematic operation act pointwise but the drivative requires the knowledge of nieghborhood
This means that derivative is not operation function
if you sketch $x^3$ and $x+6$ then you would get answer of your each question....
considering the equation
$$x^3 = x + 6$$
here $x=2$ is the solution of differential equation
but if we differentiate both sides of equation then we get
$$3x^2 = 1$$
in this case $x=2$ gives $12=1$
not satisfied
this means that two functions are just interesect not tangent to each other
If these function are actually equal then we can differenctiate both sides
For more geometric perspective the arithematic operation act pointwise but the drivative requires the knowledge of nieghborhood
This means that derivative is not operation function
if you sketch $x^3$ and $x+6$ then you would get answer of your each question....