Sides of a Right-angled Triangle $$(2n + 1)^2 + (2n^2 + 2n)^2 = (2n^2 +2n +1)^2$$
It can be used to generate infinitely many sides of right-angled triangles with integer lengths by putting values of $n = 1, 2, 3, ... $
I wanted to know that how we came to this equation. How do we know that putting n = 1, 2, 3, … into this we'll get all the sides of a right-angled triangle. I'm trying to find more about this on the internet, if you can help me what should I find about.
 A: If you start with the sequence of square numbers, and take all the differences between consecutive terms, you get all the odd numbers in sequence. For instance,
$$
2^2 - 1^2 = 3\\
3^2 - 2^2 = 5\\
4^2-3^3 = 7
$$
Some times, that odd number happens to be a square itself. For instance, we have
$$
5^2 - 4^2 = 9 = 3^2\\
13^2 - 12^2 = 25 = 5^2
$$
Rearranging these, we get Pythagorean triples:
$$
3^2 + 4^2 = 5^2\\
5^2 + 12^2 = 13^2
$$
If we want to describe all the different Pythagorean triples that appear this way, we end up with exactly your expression.
A: Your formula notes that often Pythagorean Triples are of the form $(t_1, t_2, t_2+1)$. It attempts to see when this is the case and this formula generates that, we have:
$$(2n^2+2n+1)^2-(2n^2+2n)^2=4n^2+4n+1=(2n+1)^2$$
Since the difference here is just a square, it's a valid triple. However, this misses many triples, particularly multiples of existing triples, but an example is $(8,15,17)$. I prefer the usage of:
$$(p^2-q^2)^2+(2pq)^2=(p^2+q^2)^2$$
This is most notable for its link to complex numbers, it is $$\Re(z^2)+\Im(z^2)=|z^2|$$ and this can be used to generate them. Set your calculator to Complex mode and use $(1000\text{Ran#}+\text{1000Ran#}i)^2=$ and every result will be the base and height of a Pythagoras triangle.
(Ran# is my calculators random number generator, it might be different to yours. Also it generates from $0.001$ to $1$, max $3$dp, hence my multiplying by $1000$)
A: Consider the Primitive Pythagorean triple $(a, b, c)$. Consider $b=4T_n$ where $T_n$ is the $n^{\text{th}}$ triangular number. Notice that if this is so, then the value of $c$ is $4T_n+1$. 
Note that the formula for the $n^{\text{th}}$ triangular number is given by $\frac{n(n+1)}{2}$. All that we are left to do is solve for $a$ from the following equation: $a^2+[4T_n]^2=[4T_n+1]^2$. Solving this gives the value of $a$ as $2n+1$. Hence, $(a, b, c)=(2n+1, 4T_n, 4T_n+1)$ is a Pythagorean triple.
