Solution:
The given equations are
$\begin{array}{l}
\frac{x}{a}+\frac{y}{b}=\mathrm{a}+\mathrm{b}\dots \dots(i) \\
\frac{x}{a^{2}}+\frac{y}{b^{2}}=2\dots \dots(ii)
\end{array}$
Multiplying equation(i) by b and equation(ii) by $\mathrm{b}^{2}$ and subtracting, we obtain
$\begin{array}{l}
\frac{b x}{a}-\frac{b^{2} x}{a^{2}}=a b+b^{2}-2 b^{2} \\
\Rightarrow \frac{a b-b^{2}}{a^{2}} x=a b-b^{2} \\
\Rightarrow x=\frac{\left(a b-b^{2}\right) a^{2}}{a b-b^{2}}=a^{2}
\end{array}$
Now, substituting $x=a^{2}$ in equation(i) we obtain
$\begin{array}{l}
\frac{a^{2}}{a}+\frac{y}{b}=a+b \\
\Rightarrow \frac{y}{b}=a+b-a=b \\
\Rightarrow y=b^{2}
\end{array}$
As a result, $x=a^{2}$ and $y=b^{2}$