Question: [![This is the problem](https://i.stack.imgur.com/UaVxr.png)](https://i.stack.imgur.com/UaVxr.png)

I'm not sure how they found the B matrix for this problem. I have no idea what they did since I keep getting 2,0,0 for the first column and that's already wrong.

Answer: 
Using the fact that $\sqrt{1+x}=1+\frac x{1+\sqrt{1+x}}$, we get
$$
\begin{align}
\sqrt{1+x}
&=1+\cfrac x{2+\cfrac x{2+\cfrac x{2+\cfrac x{2+\cdots}}}}
\end{align}
$$
Which gives the approximants
$$
\begin{align}
\color{#C00000}{1+\frac12x}&=1+\frac12x\\
\color{#00A000}{\frac{1+\frac34x}{1+\frac14x}}&=1+\frac12x-\frac18x^2+\frac1{32}x^3-\frac1{128}x^4+O\left(x^5\right)\\
\color{#5555FF}{\frac{1+x+\frac18x^2}{1+\frac12x}}&=1+\frac12x-\frac18x^2+\frac1{16}x^3-\frac1{32}x^4+O\left(x^5\right)\\
\color{#C0A000}{\frac{1+\frac54x+\frac5{16}x^2}{1+\frac34x+\frac1{16}x^2}}&=1+\frac12x-\frac18x^2+\frac1{16}x^3-\frac5{128}x^4+O\left(x^5\right)\\
\sqrt{1+x}&=1+\frac12x-\frac18x^2+\frac1{16}x^3-\frac5{128}x^4+O\left(x^5\right)
\end{align}
$$
[![enter image description here](https://i.stack.imgur.com/EC0A0.png)](https://i.stack.imgur.com/EC0A0.png)
Using the idea of continued fractions, observe that
$$
\sqrt{1+x}=1+(\sqrt{1+x}-1)=1+\frac{x}{2+(\sqrt{1+x}-1)}\\=1+\cfrac{x}{2+\cfrac{x}{2+(\sqrt{1+x}-1)}}=…
$$
continuing in an obvious repetitive pattern.

The computation of the (degree-balanced) partial fractions of this can be implemented (in Magma CAS) as

```
F<x>:=RationalFunctionField(Rationals());
p := 0;
for k in [1..6] do
   p := x/(2+x/(2+p));
   print 1+p;
end for;

```

with the results (for instance using <http://magma.maths.usyd.edu.au/calc/>)

```
(3*x + 4)/(x + 4)
(5*x^2 + 20*x + 16)/(x^2 + 12*x + 16)
(7*x^3 + 56*x^2 + 112*x + 64)/(x^3 + 24*x^2 + 80*x + 64)
(9*x^4 + 120*x^3 + 432*x^2 + 576*x + 256)/(x^4 + 40*x^3 + 240*x^2 + 448*x + 256)
(11*x^5 + 220*x^4 + 1232*x^3 + 2816*x^2 + 2816*x + 1024)/(x^5 + 60*x^4 + 560*x^3 + 1792*x^2 + 2304*x + 1024)
(13*x^6 + 364*x^5 + 2912*x^4 + 9984*x^3 + 16640*x^2 + 13312*x + 4096)/(x^6 + 84*x^5 + 1120*x^4 + 5376*x^3 + 11520*x^2 + 11264*x + 4096)

```

as the first six balanced Pade approximants.