Actually it's a math question. Can I cancel V from both side in step 3? thx!
No you can't. You need to take their partial derivative.
I've taken the derivative and substituted beta and k? into it. How to make it looks like step 6?
Separate names with a comma.