TITLE: Stochastic Integrals are confusing me; Please explain how to compute $\int W_sdW_s$ for example
QUESTION [15 upvotes]: I have been trying hard to understand this topic, but only failing.Reading through my lecture notes and online videos about stochastic integration but I just can't wrap my head around it. The main reason is, the notation/terminologies. I find them very very confusing and vague; some seem to interchange one another, some don't, for example "Ito integration" and "stochastic integration." Are they the same thing? Different? 
I understand my question is somewhat long, so, if tedious, please skip the bit trying to make me understand definitions and just answer, with detail, the extracted worked example I am having trouble with below
My lecture notes basically just throws things at me out of the blue saying "here's the definition. Stick with it, so here's a worked example" which I don't follow at all even with the definition.
First, here is what my notes define as a "simple process"

Stochastic pocess $(g_t)_{t \geq0}$ is said to be simple if it has the following form $g_t(\omega)=\sum_{i=0}^\infty g_i(\omega)1_{[t_i,t_{i+1})}(t)$. Where $g_i$ are random variables adapted up to time $t_i$.

And "the stochastic integral"

$X_t = \int_0^tg_sdW_s := \sum_{i=0}^\infty g_i \times(W_{t_{i+1}\cdot t}-W_{t_i\cdot t})$ where $a\cdot b$ is $min\{a,b\}$.

Here already, I get slightly confused; $X_t$ is denoted as the stochastic integral, but $X_t=X(t)$ as I understand, so this is ALSO a stochastic process itself? And what is $dW_s$? What is this variable $s$? Is it a time variable? Then doesn't it make $W_s$ a function(of $s$)? Then, unlike $dx$, $dy$, I just feel very uneasy with $dW_s$. Like, I can't express this deinition in words sensibly; "$X_t$ is a stochastic process which is an integral of a simple process $g_t$ with respect to Brownian motion $W_s$ over $0,t$....."? But what is $\omega $ in $g_t(\omega)$ in the first definition then? $g_t$ isn't a function of $W_s$, it's a function of $\omega$(whatever it is).
So these are the things that just keep going in my brain when I see this. Now here's a worked example which I am very lost with.

Find $\int_0^T W_sdW_s$ where $W_s$ is assumed to be a Brownian motion.

Here's the work interrupted with my voiceover

The Ito integrable process $g_s$ can be approximated by taking a partition o $[0,T]$ given $0=t_0<t_1<...<t_n=T$. Let $t_i-t_{i-1}=\frac{T}{n}$ and defining a simple process $g_t^n= \sum_{i=0}^{n-1} g_{t_i}1_{[t_i,t_{i+1})}(t)$.

Q. I'll accept that it "can be approximated" as a fact. But what does $g_t^n$ mean? $g_t=g(t)$ to the power of $n$? How is this in any way equal to the simple process defined above? And why is this up to $n-1$ and not $n$ or $\infty$?

Where $t_i=i\frac{T}{n}$. We will always sum from $0$ to $n-1$.

Q. Again for what reason?

Let $\Delta W_i=W_{t_{i+1}}-W_{t_i}$. then the integral is $n \rightarrow \infty$ of $\sum_iW_{t_i} \Delta W_i$.

Q. I am trying to check here; According to the definition of stochastic process integration, in this case $g_i$ is replaced with $W_{t_i}$...? Though why $t_i$ and not $i$ as in the definition? 

We begin by observing that $W_T^2=\sum_i(W_{t_{i+1}}^2-W_{t_i}^2)$

Q. Why $W_T^2$ in particular? Where did this "square" come out of? And is this $T$...$\infty$? Because that is where we're tending $n$ to, yes? And why does this equal the RHS? I am having trouble algebraically showing that this is equal.

using the identity $(a-b)b=\frac{1}{2}(a^2-b^2-(a-b)^2)$, we obtain, $\sum_i(W_{t_{i+1}}-W_{t_i})^2+2 \sum_i W_{t_i}(W_{t_{i+1}}-W_{t_i})$.

And the rest follows if I understand what is up there. And this question is getting too long so I will stop here. Can someone please help me understand? Thank you very much

REPLY [6 votes]: This is sort of an "extended comment" rather than a direct answer to all of your questions; your questions all seem to revolve around "what the heck are we doing here, really?!" and while @saz gets my upvote for patiently answering each of your actual questions, I feel like the spirit of the question is perhaps still open.
The first thing to say is that noise -- stochastic mathematics -- is about doing calculus with highly non-differentiable functions. If you've got some sort of electrical circuit, you can describe the differential equations that govern it -- but if the input signal at this end is noisy, then that really means that the differential equations cannot give you the proper answer with standard calculus.
Cumulants, Sums of Random Variables, Central Limit Thm.
First off let's just breeze through a bunch of classical probability, because I want to introduce the fact that variance is pseudo-linear but it's a much more general story.
Suppose we have a random variable $X$ distributed with some PDF $f(x),$ then the Fourier transform of that PDF is called its characteristic function, $$f[k] = \langle e^{-2\pi ikX}\rangle = \int_{-\infty}^{\infty}dx~f(x)~e^{-2\pi i k x}.$$
If $Z = X + Y$ where $X$ and $Y$ are independent, and $Y$ has PDF $g(y)$ and $Z$ therefore has PDF $h(z),$ then it turns out we have $h[k] = f[k]~g[k].$ Therefore the logarithm of a Fourier transform of a PDF is pseudo-linear, in the sense that it is linear in independent random variables. 
The Maclaurin series of this logarithm is the cumulant expansion $$\log f[k] = 0 + \mu~(-2\pi i k) + \frac12~\sigma^2~(-2\pi i k)^2 + \dots = \sum_{n=1}^{\infty} \kappa_n ~ {(-2\pi i k)^n \over n!}.$$Each cumulant is likewise pseudo-linear. You can get some special cases by simply expanding out the terms individually, for example, the first derivative is $f'[k]/f[k]$ and at $k=0$ this is $\langle -2 \pi i X\rangle$ so $\mu = \langle X \rangle,$ while the second derivative is $(f[k]~f''[k] - f'[k]~f'[k])/f[k]^2$ which is $(-2\pi i)^2 \big(\langle X^2\rangle - \langle X \rangle^2\big).$ So the first two cumulants are mean and variance.
Furthermore under the scaling $X \mapsto \alpha X$ we can see that $\langle e^{-2\pi i k \alpha X}\rangle = f[\alpha k]$ and thus the effect is to map the cumulants each $\kappa_n \mapsto \alpha^n \kappa_n.$ So that's our scaling law.
The combined effect of these is one of the easiest ways to see the central limit theorem: the sum $Z = \sum_{m=1}^M X_m/M,$ for independent, identically distributed $X_m$ is going to have cumulants $\kappa_n / M^{n-1},$ with one $M$ coming from pseudo-linearity and the rest of the $M^{-n}$ coming from this scaling law. Keeping only the leading two terms gives you the mean and standard deviation, and all other cumulants are zero -- but this quadratic logarithm is characteristic of a Gaussian characteristic function, and the Fourier transform of a Gaussian is a Gaussian, so you get a Gaussian probability distribution.
From pseudo-linear variance to random walks.
So now if we imagine a noise source which is a limit of a random walk process --the sum of lots of steps in random directions over infinitesimal times -- we know that the short autocorrelation time of those steps leads to this sum of that signal having a variance proportional to duration. (In other words, we have $N$ independent steps, since variance is pseudo-linear variance grows proportional to $N$, but at the same time we know that for this walk, $N$ grows linearly with $t$, so the variance needs to go proportional to the time interval of the walk.) So, we can describe a bunch of different things if we start from a perfect white noise source where $dW$ is some little unit of noise with zero mean that obeys the heuristic equation $dW^2 = dt$ -- everything else is additive constants and such. $dW$ is often called a Wiener process or Brownian motion, and it is the integral of a "Gaussian white noise" source. We can also imagine that higher-order differentials are essentially nothing, as the Central Limit Theorem tells us that the higher-order cumulants vanish anyway leaving just the Gaussian distribution.
Step back a second and think about how we have to think about this random walk $dW.$ In practice, we need it to also be a function with respect to time, $dW(t).$ Mathematicians for some reason usually write this as a suffix, $dW_t;$ physicists are more comfortable with writing it with parentheses. So then we have that the stochastic increment in a variable $X$ over a time step is equal to some random noise with standard deviation $\sigma(t)$ and mean $\mu(t),$ or:$$dX_t = \sigma_t ~ dW_t + \mu_t ~ dt.$$
This $X$ is known as an "Itô process." The key result about such processes -- which is the same as our heuristic $dW_t^2 = dt$ above -- is called Itô's lemma: let $f(x, t)$ be twice-differentiable and apply it term-by-term to the time-sequence $X_t,$ then the resulting transformed sequences is another Itô process, and its corresponding stochastic equation is:$$\begin{align}df(X_t, t) \approx&~ f(X_t + dX_t, t + dt) - f(X_t, t)\\
\approx&~ f(X_t, t) + \frac{\partial f}{\partial t} ~dt + \frac{\partial f}{\partial x}~dX_t + \frac12~\frac{\partial^2 f}{\partial x^2} dX_t^2 - f(X_t) \end{align}$$Keeping terms to order $dt$ with our heuristic rule $dW = \sqrt{dt}$ gives:$$
df(X_t, t) = \left(\frac{\partial f}{\partial t} + \frac{\partial f}{\partial x}~\mu_t + \frac12~\frac{\partial^2 f}{\partial x^2} ~\sigma_t^2\right)~dt  + \sigma_t~ \frac{\partial f}{\partial x} ~dW_t.$$This can be viewed as a modification of the chain rule to make it apply even when we're dealing with these non-differentiable functions.
From algebra to computer simulations.
So there turns out to be another way to do stochastic calculus which preserves the chain rule, called the Stratonovich integral, and it preserves the chain rule. Why would we use this clumsy Itô formalism with its broken chain rule?!
Well it turns out to be one of those things where there's sort of a bunch of different criteria and it's impossible to satisfactorily get them all right. What Itô does that Stratonovich is bad with, is that once you have the Itô differential equation, you have the computer simulation. This is very powerful. The formal statement of this is given by the Itô integral: choose an integration mesh of $N$ points in time $t_n$, with $T = t_N.$ Then $$\int_0^T H(\tau)~dW(\tau) = \lim_{N \to \infty} ~ \sum_{n=1}^N ~ H(t_n) \cdot \big(W(t_n) - W(t_{n-1})\big).$$(the limit only works, of course, if the maximum size in the mesh shrinks to 0 as the points go to infinity...) 
In other words, if you use a fine enough mesh, you can just simulate this by taking random walk steps of the appropriate size (Gaussian random variables with standard deviation $\sqrt{t_n - t_{n-1}}$) and summing up their aggregate response. 
So once you know how your differential equations work, you use this $dW = \sqrt{dt}$ heuristic to put some noise through them, keep the leading terms in $dt,$ and then you know how the output responds to a certain noise profile. 
Then you run thousands of simulations with your computer to see what actually emerges -- for example, how long your wind turbines last under a realistic noisy load of wind speeds.
Where the field goes from there.
If you work in applied math or the physical sciences, then you'll usually want to determine how this noise looks in the frequency spectrum, how other noise spectra come into the integral, and you may have to deal with a discrete counter or so where $dN$ must be either 0 or 1 and usually the summation of that process will look like a Poisson process, all that good stuff. So the Wiener process is just our most easy-to-handle noise source, but not necessarily our only conceivable one.  Studying those $dN$ increments then becomes a task for "queueing theory."
Then there's things like control theory, where you start trying to figure out what the optimal parameters are to control a system which has a noisy input, like a stock market, or a quantum system.
And you can also kind of jump into the deep end of theory -- the late Paul Malliavin forged new ground (I think in the 70s and 80s?) by generalizing calculus-of-variations to a stochastic context, whereupon we discovered that you can do stochastic integration by parts and some guy named Anatoliy Skorokhod discovered that a generalization of the Itô integral is also the infinite-dimensional vector divergence operator.