I write equations in eqnarrayuse Latex, but there are lines that exceed the right margin, how to fix it?
This is my code:
\begin{eqnarray}
k_1&=&hf(t_i, y_i)=hf_i \label{$k_1$ RK-4}\\
k_2&=&hf(t_i+p_1h, y_i+q_11_k1)\nonumber\\
&=&h(f_i+p_1hf_t+q_{11}k_1f_y)\nonumber\\
&=&h(f_i+p_1hf_t+q_{11}hf_if_y)\\
k_3&=&hf(t_i+p_2h,y_i+q_21k_1+q_22k_2)\nonumber\\
&=&h(f_i+p_2hf_t+q_21k_1f_y+q_22k_2f_y)\nonumber\\
&=&h(f_i+p_2hf_t+q_{21}hf_if_y+q_{22} h(f_i+p_1hf_t+q_{11}hf_if_y)f_y)\nonumber\\
&=&h(f_i+p_2hf_t+q_{21}hf_if_y+q_{22}hf_if_y +q_22h^2p_1f_tf_y+q_{11}q{22}h^2f_i(f_y)^2)\\
k_4&=&hf(t_i+p_3h, y_i+q_31k_1+q_32k_2+q_33k_3)\nonumber\\
&=&h(f_i+p_3hf_t+q_{31}k_1f_y+q_{32}k_2f_y+q_{33}k_3f_y)\nonumber\\
&=&h(f_i+p_3hf_t+q_{31}hf_if_y+q_{32} h(f_i+p_1hf_t+q_{11}hf_if_y)f_y +q_{33}h(f_i+p_2hf_t+q_{21}hf_if_y+q_{22}hf_if_y+q_{22}h^2p_1f_tf_y+q_{21}q_{22}h^2f_i(f_y)^2)f_y)\nonumber\\
&=&h(f_i+p_3hf_t+q_{31}hf_if_y+q_{32}hf_if_y +p_1q_{32}h^2f_tf_y +q_{11}q_{32}h^2f_i(f_y)^2+q_{33}hf_if_y+p_2q_{33}h^2f_tf_y+q_{21}q_{33}h^2f_i(f_y)^2+q_{22}q_{33}h^2f_i(f_y)^2+q_{22}q_{33}p_1h^3f_t(f_y)^2+q_{11}q_{22}q_{33}h^3f_i(f_y)^3)\\
\end{eqnarray}
and this is the result:



aligninstead ofeqnarray. (However, the latter does not solve the problem automatically,breqndoes in principle but I personally would rather break the lines by hand than usingbreqn.) – Mar 15 '19 at 01:07>s in your code block prevent your code from being compilable. Removing that is better. (and I did it for you.) – Mar 15 '19 at 03:54