Calculate stochastic integral $\int_0^T s^2 W_s dW_s$ I faced some troubles trying to evaluate Ito's integral $\int_0^T s^2 W_s dW_s$ by definition. My attempt is $\int_0^T s^2 W_s dW_s = \sum_{i=0}^{N-1} t_i^2 W_{t_i} (W_{t_{i+1}}-W_{t_i}) = X - \sum_{i=0}^{N-1} t_i^2 W_{t_i}^2 = X - (T^3+2T^2\int_0^TW_sdW_s)$, since $W_T^2 = T + 2\int_0^T W_s dW_s$. Unfortunately, I have no idea how to proceed with the first summand $X$ by definition, to be more precise, I stuck with $W_{t_{i+1}}W_{t_i}$ term.
Can anyone show me how to deal with it? If there is any mistake in my evaluation of the second term, please notify me too. Thanks in advance.
 A: As noted in the comments, this is a random variable, but it looks like you're looking for an equality similar to something like $$\frac{1}{2}(W_T^2 - T) = \int_0^T W_s \,dW_s.$$
In other words, you're looking for a smooth function $f:\mathbb{R}^2 \to \mathbb{R}$ so that $$f(W_T,T) = \int_0^T s^2 W_s\,dW_s.$$
This interpretation of your question is mentioned in the comments, and I think that this is the sort of thing you're looking for.  By Itô's Lemma, we would need $f$ to satisfy $$\begin{cases}\displaystyle\frac{\partial f}{\partial x} = t^2 x, \\
\displaystyle\frac{\partial f}{\partial t} + \frac{1}{2} \frac{\partial^2 f}{\partial x^2} = 0, \\
f(0,0)=0 \end{cases}$$
which you can check has no solution since the first equation implies $\frac{\partial^2 f}{\partial x^2}$ is constant with respect to $x$, thereby making the second equation impossible.
To answer the question about "indefinite integration for Itô integrals," the answer is that you can "find an antiderivative" (i.e. an answer of the form $f(W_T,T)$) when you're integrating $\frac{\partial f}{\partial x}$ where $f$ satisfies the diffusion equation $$\frac{\partial f}{\partial t} = -\frac{1}{2}\frac{\partial^2 f}{\partial x^2}.$$
This can be seen from Itô's Lemma.
A: As an example for solving $\int_{0}^{T}s^2 W_{s}\mathrm{d}W_{s}$ let define double differentiable function $F(t,W_{t})$ of two real variables $t$ and $W_{t}$. With this function combined with Ito's Lemma follows:
\begin{equation*}
     \begin{array}{rcl}
      \mathrm{d}F&=& \displaystyle \frac{\partial F}{\partial t}\mathrm{d}t+\frac{\partial F}{\partial W_{t}}\mathrm{d}W_{t}+\frac{1}{2}\frac{\partial^{2}F}{\partial W_{t}^{2}}\mathrm{d}W_{t}^2+\cdots \\
     \end{array}
    \end{equation*}
Now set $\displaystyle \frac{\partial F}{\partial W_{t}}=t^2 W_{t}$ then follows for $F=\displaystyle\tfrac{1}{2}t^2 W_{t}^2$, $\dfrac{\partial F}{\partial t}=\displaystyle t W_{t}^2$ and $\dfrac{\partial^{2}F}{\partial W_{t}^{2}}=\displaystyle t^2$:
\begin{equation*}
\begin{array}{rcl}
\displaystyle\mathrm{d}F&\approx& \displaystyle \frac{\partial F}{\partial t}\mathrm{d}t+\frac{\partial F}{\partial W_{t}}\mathrm{d}W_{t}+\frac{1}{2}\frac{\partial^{2}F}{\partial W_{t}^{2}}\mathrm{d}t \\
    \displaystyle\mathrm{d}\left(\tfrac{1}{2}t^2 W_{t}^2\right)&\approx&\displaystyle t W_{t}^2\mathrm{d}t+t^2 W_{t}\mathrm{d}W_{t}+\tfrac{1}{2}t^2\mathrm{d}t \\
    \displaystyle\int_{0}^{T}\mathrm{d}\left(\tfrac{1}{2}s^2 W_{s}^2\right)&\approx&\displaystyle\int_{0}^{T}s W_{s}^2\mathrm{d}s+\int_{0}^{T}s^2 W_{s}\mathrm{d}W_{s}+\tfrac{1}{2}\int_{0}^{T}s^2\mathrm{d}s \\
\displaystyle\tfrac{1}{2}T^2 W_{T}^2&\approx&\displaystyle \int_{0}^{T}s W_{s}^2\mathrm{d}s+\int_{0}^{T}s^2 W_{s}\mathrm{d}W_{s}+\tfrac{1}{6}T^3\Rightarrow \\ 
\displaystyle\int_{0}^{T}s^2 W_{s}\mathrm{d}W_{s}&\approx&\displaystyle\tfrac{1}{2}T^2 W_{T}^2-\int_{0}^{T}s W_{s}^2\mathrm{d}s-\tfrac{1}{6}T^3 \\
\end{array}
\end{equation*}
Let calculate the expected value for $\displaystyle\int_{0}^{T}s W_{s}^2\mathrm{d}s$:
\begin{equation*}
\begin{array}{rcl}
\displaystyle\mathbb{E}\left [\int_{0}^{T}s W_{s}^2\mathrm{d}s\right]&=&\displaystyle\int_{0}^{T}\mathbb{E}\left [s W_{s}^2\right ]\mathrm{d}s \\
&=&\displaystyle\int_{0}^{T}s^{2}\mathrm{d}s \\
&=&\displaystyle\tfrac{1}{3}T^3 \\
\end{array}
\end{equation*}
Let define $W_{s}$ as a continuous time stochastic process with independent and identically normal distributed random variables than follows for $\mathbb{E}\left [s W_{s}^2\right]$.
\begin{equation*}
\begin{array}{rcl}
\displaystyle\mathbb{E}\left [s W_{s}^2\right ]&=&\displaystyle \int_{-\infty}^{\infty} s x^2 f\left(x\right)\mathrm{d}x \\
&=&\displaystyle \int_{-\infty}^{\infty}s x^2 \frac{1}{\sqrt{2\pi s}}\,e^{-\dfrac{x^2}{2s}}\mathrm{d}x \\
&=&s^{2} \\
\end{array}
\end{equation*}
Finally with $\displaystyle\int_{0}^{T}s W_{s}^2\mathrm{d}s=\tfrac{1}{3}T^3$ follows the desired answer:
\begin{equation*}
\begin{array}{rcl}
\displaystyle\int_{0}^{T}s^2 W_{s}\mathrm{d}W_{s}&\approx&\displaystyle\tfrac{1}{2}T^2 W_{T}^2-\tfrac{1}{3}T^3-\tfrac{1}{6}T^3 \\
&\approx&\displaystyle\tfrac{1}{2}T^2 W_{T}^2-\tfrac{1}{2}T^3\\
\end{array}
\end{equation*}
