2. Given that $a$ and $b$ are non-zero constants, and
$$
\frac{a^{2}}{\sin ^{2} \theta}+\frac{b^{2}}{\cos ^{2} \theta}=(a+b)^{2} \text {. }
$$

Then $\frac{a^{3}}{\sin ^{4} \theta}+\frac{b^{3}}{\cos ^{4} \theta}=$ (express in terms of $a$ and $b$).
2. $(a+b)^{3}$.

Given the equation, after removing the denominator, we get
$$
a^{2} \cos ^{2} \theta+b^{2}\left(1-\cos ^{2} \theta\right)=(a+b)^{2} \cos ^{2} \theta\left(1-\cos ^{2} \theta\right) \text {, }
$$

which simplifies to $\left[(a+b) \cos ^{2} \theta-b\right]^{2}=0$.
However, $a+b \neq 0$ (otherwise, from the given equation, we would have $a=b=0$, which contradicts the given conditions), so,
$$
\begin{array}{l}
\cos ^{2} \theta=\frac{b}{a+b}, \sin ^{2} \theta=\frac{a}{a+b} . \\
\text { Therefore, the original expression }=a(a+b)^{2}+b(a+b)^{2}=(a+b)^{3} .
\end{array}
$$