Resizing a matrix to fit into the page width
Shrinking the text should only be as a last resort (and even then avoid doing it)
I would use a layout such as
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{multicol}
\usepackage[makeroom]{cancel}
\begin{document}
\begin{equation}% don't use align if no alignment
\begin{bmatrix}a_{11}&a_{12}\\a_{21}&a_{22}\end{bmatrix}
\end{equation}
where
\begin{align*}
a_{11}&=\frac{-\lambda u_t}{u^2}+uu_x-(-u_xu_{xx}-uu_{xxx}-2u_xu_{xx})\\
a_{12}&=i (+uu_{xx}+u_x^2-4 \lambda^2)+2i\lambda (u_x+2\lambda)-(i(u^2_x+uu_{xx}+2\lambda u_x)) \\
a_{21}&=i(-uu_{xx}-u_x^2+4\lambda^2)+2i\lambda (u_x-2 \lambda)+i(u^2_x+uu_{xx}-2\lambda u_x) \\
a_{22}&=\frac{\lambda u_t}{u^2}-uu_x-(u_x u_{xx}+uu_{xxx}+2u_x u_{xx})
\end{align*}
\end{document}
- in any equation code had not to be empty lines
- for shrinking your equation to text width I suggest to use
\medmath
from thenccmath
package (which reduce equation size for about 1/4) - split long math term into two lines:
\documentclass{article}
%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
\usepackage{nccmath, mathtools}
\usepackage{multicol}
\usepackage[makeroom]{cancel}
\begin{document}
\begin{align}\setlength\arraycolsep{1pt}
\medmath{
\begin{bmatrix}
\begin{multlined}
-\mfrac{\lambda u_t}{u^2}+uu_x \\
-(-u_xu_{xx}-uu_{xxx}-2u_xu_{xx})
\end{multlined} & \begin{multlined}
i(+uu_{xx}+u_x^2-4 \lambda^2)+2i\lambda (u_x+2\lambda) \\
- i(u^2_x+uu_{xx}+2\lambda u_x)
\end{multlined} \\[7ex]
\begin{multlined}
i(-uu_{xx}-u_x^2+4\lambda^2) \\
+2i\lambda (u_x-2 \lambda)+i(u^2_x+uu_{xx}-2\lambda u_x)
\end{multlined} & \begin{multlined}
\mfrac{\lambda u_t}{u^2} - uu_x \\
-(u_x u_{xx}+uu_{xxx}+2u_x u_{xx})
\end{multlined}
\end{bmatrix}}
\end{align}
\end{document}
If you try to fix the equation within the text width, then try with adjustbox.sty
, but the resolution may affects, here is the MWE
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{multicol}
\usepackage[makeroom]{cancel}
\usepackage{adjustbox}
\begin{document}
\noindent\adjustbox{minipage=[r][0.5\textwidth][b]{0.25\textwidth},scale={0.6}}{
\begin{align}
\begin{bmatrix}
\dfrac{-\lambda u_t}{u^2}+uu_x-(-u_xu_{xx}-uu_{xxx}-2u_xu_{xx}) & i (+uu_{xx}+u_x^2-4 \lambda^2)+2i\lambda (u_x+2\lambda)-(i(u^2_x+uu_{xx}+2\lambda u_x)) \\
i(-uu_{xx}-u_x^2+4\lambda^2)+2i\lambda (u_x-2 \lambda)+i(u^2_x+uu_{xx}-2\lambda u_x) & \dfrac{\lambda u_t}{u^2}-uu_x-(u_x u_{xx}+uu_{xxx}+2u_x u_{xx})\\
\end{bmatrix}
\end{align}
}
\end{document}