# Differentiating Wiener process

I have come across an expression as below

$$d\left({W_t}^4\right) = 4 {W_t}^3 d\left({W_t}\right) + 6{W_t}^2 dt$$

where $$W_t$$ is standard Wiener process.

While I understand the first part of the RHS, I fail to understand the second part.

Could you please help to explain it? What is the expression for the general case i.e. $$d\left({W_t}^n\right)$$

Let $$\text dX_t=\mu_t\text dt+\sigma_t\text dW_t$$ be an Itô process. Itô's Lemma tells us $$\text df(t,X_t)=\left(f_t+\mu_tf_x+\frac{1}{2}\sigma_t^2f_{xx}\right)\text dt+\sigma_tf_x\text dW_t.$$

You're interested in the special case of a Brownian motion with $$\mu_t=0$$ and $$\sigma_t=1$$ (ie, $$X_t=W_t$$). Thus, Itô's Lemma simplifies to $$\text df(t,W_t)=\left(f_t+\frac{1}{2}f_{xx}\right)\text dt+f_x\text dW_t.$$

In your case, $$f(t,x)=x^4$$ with $$f_t=0$$, $$f_x=4x^3$$, and $$f_{xx}=12x^2$$. Thus, $$\text d (W_t^4)=6W_t^2\text dt+4W_t^3\text dW_t.$$

As for the more general $$f(t,x)=x^n$$, we have $$f_t=0$$, $$f_x=nx^{n-1}$$, and $$f_{xx}=n(n-1)x^{n-2}$$. Thus, $$\text d (W_t^n)=\frac{n(n-1)}{2}W_t^{n-2}\text dt+nW_t^{n-1}\text dW_t.$$ Of course, if you set $$n=4$$, you recover the prior special case.