I have never done anything like this before so it was a little difficult for me too.
There are some typo style errors in the online derivation which certainly would have helped confuse you.
Each term if the product of an AP term and a GP term
The AP is a, a+d, a+2d, …. a+(n-1)d ….
The GP is b, br, br^2, …… br^(n-1), …..
The AP-GP is ab, (a+d)br, (a+2d)br^2, …… [a+(n-1)d]br^n-1 ….
Now you want the sum to n terms.
\(S_n=ab+(a+d)br \;+(a+2d)br^2 +(a+3d)br^3\;+\; \dots\;+[a+(n-1)d]br^{n-1}\\ \text{multiply both sides by r}\\ rS_n=\qquad \qquad abr \;+\; (a+d)br^2 \;+\; (a+2d)br^3 \;+\; \dots\;\;+[a+(n-2)d]br^{n-1}+\;\; [a+(n-1)d]br^{n}\\ subtract\\ (1-r)S_n=ab+br(a+d-a)+br^2(a+2d-a-d)+...+br^{n-1}[a+(n-1)d-\{a+(n-2)d\}]-[a+(n-1)d]br^{n}\\ (1-r)S_n=ab+br(d)+br^2(2d-d)+...+br^{n-1}[(n-1)d-\{(n-2)d\}]-[a+(n-1)d]br^{n}\\ (1-r)S_n=ab+br(d)+br^2(2d-d)+...+br^{n-1}[(nd-d-nd+2d]-[a+(n-1)d]br^{n}\\ (1-r)S_n=ab+brd+br^2d+...+br^{n-1}d-[a+(n-1)d]br^{n}\\ (1-r)S_n=ab+bdr+bdr^2+...+bdr^{n-1}-[a+(n-1)d]br^{n}\\~\\ (1-r)S_n=ab+[bdr+bdr^2+...+bdr^{n-1}]-[a+(n-1)d]br^{n}\\ \\~\\(1-r)S_n=ab+[sum\;of\;GP]\qquad \qquad -[a+(n-1)d]br^{n}\\ \)
Let's look at the sum of a GP part
\(bdr+bdr^2+...+bdr^{n-1}\\ \text{The first term is bdr and the common ratio is r so}\\ =(bdr)+(bdr)r+...+(bdr)r^{n-2}\\ \text{So the last term is the n-1 term}\\ \text{so in the formula for the sum of a GP r is r, a is replaced with bdr, and n is replaced with n-1}\\ =\frac{bdr(1-r^{n-1})}{1-r}\\ =\frac{bdr(\frac{r-r^n}{r})}{1-r}\\ =\frac{bd(r-r^n)}{1-r}\\ =\frac{bdr(1-r^{n-1})}{1-r}\\ so\\ (1-r)S_n=ab+[sum\;of \;a\;GP]-[a+(n-1)d]br^{n}\\ (1-r)S_n=ab+[\frac{bdr(1-r^{n-1})}{1-r}]-[a+(n-1)d]br^{n}\\ \)
\((1-r)S_n=ab+[\frac{bdr(1-r^{n-1})}{1-r}]-[a+(n-1)d]br^{n}\\~\\ S_n=\dfrac{ab}{1-r}+\dfrac{bdr(1-r^{n-1})}{(1-r)^2}-\dfrac{[a+(n-1)d]br^{n}}{1-r}\\\)
------------------------------------------
Oh dear, some of my latex has been trucated.
I think you should still be able to work it out but let me know if you cannot follow it :/