1

please how to make the last row in the table ? I try but it the second column did not be centered

enter image description here

this is my try

\begin{tabular}{ |c|c| } 

 \hline

 R(x) & Form of $y_p$  \\ 

  \hline  \hline

$Cx^n$ &$A_0x^n + A_1x^{n-1} + \ldots + A_{n-1}x + A_n$  \\ 

\hline

$ Ce^{rx}$ & $Ae^{rx}$  \\ 

 \hline

 $Ce^{rx} cos(kx)$\\  $Ce^{rx} sin(kx)$ &$ Ae^{rx} cos(kx) + Be^{rx} sin(kx)$\\

 \hline

\end{tabular}

enter image description here

  • please add the tags what you tried... – MadyYuvi Jul 13 '17 at 9:10
  • 1
    It would be great if you could show us what you have tried. Posting a minimal working example that indicates what you are trying to do makes it easier for people to understand what you want. It also makes it easier for people to help you, since they have some code to start from, and hence much more likely that some one will try to help you. – Andrew Jul 13 '17 at 9:12
  • Unfortunately you've added only a code snippet. This is better than nothing, but still not a minimal working example. Please have a look at the link in Andrew's comment. – Schweinebacke Jul 13 '17 at 9:28
1

You can use, e.g., an array in an array:

\documentclass{article}

\usepackage{amsmath}

\begin{document}
\[
  \begin{array}{|c|c|}
    \hline
    R(x) & \text{Form of }y_p \\
    \hline\hline
    Cx^n & A_0x^n+A_yx^{n-1}+\cdots+A_{n-1}x+A_n \\
    \hline
    Ce^{rx} & Ae^{rx} \\
    \hline
    \begin{array}[c]{@{}c@{}}
      Ce^{rx}\cos(kx) \\
      Ce^{rx}\sin(kx) \\
    \end{array} &
                  Ae^{rx}\cos(kx)+Be^{rx}\sin(kx) \\
    \hline
  \end{array}
\]
\end{document}

array in array

  • @MarwanAliSharawy Meanwhile you've several questions with helpful answers. Please note, that you should vote for good answers and that it would help other, if you could accept answers. See our Help Center for information why voting is important and The Tour how to do so. – Schweinebacke Jul 13 '17 at 9:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.