How to derive the voltage equation of capacitor in a circuit?
Homework, I presume. Only guidance is available.

This problem is good because it forces the student to think qualitatively what actually happens in the circuit. One capacitor, a switch, resistors, a source - being able to see what happens in a circuit this complex (or this simple) is an essential skill for proper understanding and designing analog circuits.

Question (a) can be solved by thinking that the capacitor has been charged from the voltage source infinitely long time before t=0. The result can, of course, be calculated, too as the limit value t=+infinite when a RC series circuit is connected to a voltage source or with final value theorem, but practical electrician is assumed to see immediately it's 50V.

KVL method for t>0 needs 2 current loops which have common parts. That's your most basic error. Make one KCL equation for the currents which depart from the top end of the switch.

The Thevenin equivalent method for t>0 is the way how a practical electrician is assumed to see the happenings in the circuit. A precharged capacitor is connected to the output of a voltage divider. 

The practical calculation procedure: The capacitor has 50V initial voltage, but for t>0 it's connected to a voltage divider which outputs only 25V through 500kOhm Rt. Time constant = 1s and that's used for calculating how 50V initial Vc settles towards 25V. 50V decays off and at the same time the capacitor is charged to 25V. The practical straight in the fly equation for this is Vc=50V*(exp(-t/1s)) + 25V*(1-exp(-t/1s))

Your job is to make this calculation formally acceptably.