Your friends solution is correct. If $(X_t)_{t \geq 0}$ is a one-dimensional Itô process, then Itô's formula states $$ df(t,X_t)= \partial_x f(t,X_t) \, dX_t + \left(\frac{1}{2} \partial_x^2 f(t,X_t) \right) d\langle X \rangle_t + \partial_t f(t,X_t) \, dt. \tag{1}$$ Your friend used this identity for $f(t,x) := x e^{-ct}$.
Your attempt:
$\frac{\partial}{\partial W_t} \left( X_0 e^{ct} + \sigma e^{ct} \int_0^t e^{-cs} \, dW_s \right)$
It this how you are taught to write down Itô's formula? In my oppinion, that's not a good way to write it this way. The problem is that you cannot apply Itô's formula this way. Itô's formula gives you the differential for $f(t,W_t)$ for (nice) functions $f$. But here, you want to calculate the differential of the expression
$$\int_0^t e^{-cs} \, dW_s,$$
i.e. we need a function $f$ such that
$$f(t,W_t) \stackrel{!??!}{=} \int_0^t e^{-cs} \, dW_s.$$
... tell me: How do you choose $f$? Before you have not chosen such a function $f$, you cannot apply Itô's formula this way. What you are doing is treating it as a constant and that's simply not correct.
In order to solve this SDE (or check that the given process is a solution to the SDE) you really have to use Itô's formula for Itô proceses, i.e. $(1)$.
Remark The solution your friend suggested applies Itô's formula to the process
$$e^{-ct} X_t \tag{1}$$
and, at the first glance, it is not obvious how to come up with this particular process. The idea is the following: Instead of considering the SDE
$$dX_t = c X_t \, dt + \sigma \, dW_t$$
we consider the corresponding ODE
$$dx_t = cx_t \, dt$$
(i.e. we just we leave away the stochastic part). It is well-known that the unique solution to this ordinary differential equation is given by
$$x_t = C e^{ct}$$
where $C \in \mathbb{R}$. So far, $C$ is some "deterministic" constant. Now, however, we return to our stochastic setting and allow $C$ to depend on $\omega$ (this is the counterpart of the variation of constants-approach for SDEs). So, by the previous identity, our new auxilary process $C$ is given by
$$C_t = e^{-ct} X_t$$
... and this is exactly the process from $(1)$.
There are a lot of examples where this approach [i.e. first solve the corresponding ODE and then make a "stochastic" variation of constants] works, ee e.g. this question. However, I don't know any statements for which types of SDEs this approach works and for which it doesn't.
Best Answer
Let us take a long route for practice's sake. As we have $u(x,t)=\ln(x^2)$ we can use Ito directly: $$\frac{\partial u}{\partial t}=0 \ \ \ \ \ \ \ \ \frac{\partial u}{\partial x}=2x\frac{1}{x^2}=\frac{2}{x} \ \ \ \ \ \ \ \ \frac{\partial^2 u}{\partial x^2}=-\frac{2}{x^2}$$ So $$\begin{aligned}du&=\frac{\partial u}{\partial x}(X_t,t)dX_t+\frac{1}{2}\sigma^2X^2_t\frac{\partial^2 u}{\partial x^2}(X_t,t)dt=\\ &=\frac{2}{X_t}\bigg(\mu X_tdt+\sigma X_tdW_t\bigg)+\frac{1}{2}\sigma^2(-2)dt=\\ &=(2\mu-\sigma^2) dt+2\sigma dW_t \end{aligned}$$ therefore $$\begin{aligned}u(X_T,T)-u(X_t,t)&=(2\mu-\sigma^2)(T-t)+2\sigma(W_t-W_t)\\ \ln(X_T^2)&=\ln(X_t^2)+(2\mu-\sigma^2)(T-t)+2\sigma(W_t-W_t)\\ \\ \ln(X_T^2)|\mathcal{F}_t&\sim \mathcal{N}(\ln(X_t^2)+(2\mu-\sigma^2)(T-t),\,4\sigma^2(T-t)) \end{aligned}$$ and finally $$E[\ln(X_T^2)|\mathcal{F}_t]=\ln(X_t^2)+(2\mu-\sigma^2)(T-t)$$ $$\implies u(x,t)=\ln(x^2)+(2\mu-\sigma^2)(T-t)$$ Notice that $$\ln((X_T/X_t)^2)=2\ln(X_T/X_t)|\mathcal{F_t}\sim \mathcal{N}((2\mu-\sigma^2)(T-t),4\sigma^2(T-t))$$ So $E[\ln((X_T/X_t)^2)|\mathcal{F_t}]=(2\mu-\sigma^2)(T-t)$ and the result you wanted is proved.