# Differentiating both sides wrt different variables confusion

My high school calculus has totally lost the plot here. According to the book, you integrate$$2\frac{\ddot{a}}{a}+\frac{\dot{a}^{2}}{a^{2}}=\varLambda$$to get$$a\dot{a}^{2}=\frac{\varLambda}{3}a^{3}+K,$$where the dots are derivatives wrt time and $K$ is a constant of integration. (It's a cosmology equation, by the way – $a$ is the scale factor, $\varLambda$ is the cosmological constant.) Well, I've no idea how the author did this, so I thought I'd try to differentiate the second equation to get to the first. This works, but only if I differentiate the left term wrt time, and the right term wrt to $a$, which doesn't seem legal. Is this to do with implicit differentiation? Advice much appreciated. Thanks.

Multiply through by $a^2\dot{a}$ to get

$$2a\ddot{a}\dot{a} + \dot{a}^3 = \Lambda a^2\dot{a}$$

$$a \frac{d}{dt}(\dot{a}^2) + \dot{a}\cdot\dot{a}^2 = \Lambda a^2 \dot{a}$$

By the product rule, we have

$$\frac{d}{dt}(a\dot{a}^2) = \Lambda a^2 \dot{a}$$

Finally, integrate

$$a\dot{a}^2 = \Lambda \frac{a^3}{3} + K$$

• How did you see that? – Peter4075 May 28 '18 at 10:46
• Given the answer, one could always work backwards. – mickep May 28 '18 at 10:48