# Calculating scheme for a particular solution of a linear differential equation (UCM)

The following is calculating scheme for a particular solution of a linear differential equation via the undetermined coefficient method. The result is quite okay, using the library tikzmark of TikZ.

I am expecting better (in your opinion) codes, with TikZ or just with LaTeX. Using TikZ seems too heavy and lengthy. Thank you in advance.

\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{tikzmark}
\begin{document}
\begin{align*}
y^*    &\tikzmarknode{e1}{=} Ate^{2t}+Be^{-2t}\\
(y^*)' &\tikzmarknode{e2}{=} A(1+2t)e^{2t}-2Be^{-2t}\\
(y^*)''&\tikzmarknode{e3}{=} A(4+4t)e^{2t}+4Be^{-2t}\3mm] 1 &\tikzmarknode{e4}{=} 4A-5A=-A\\ 1 &\tikzmarknode{e5}{=} 4B+10B+6B=20B \end{align*} \begin{tikzpicture}[overlay,remember picture] \path[nodes={magenta,left}] (e1)+(-2,0) node{6\quad \times} (e2)+(-2,0) node{-5\quad \times} (e3)+(-2,0) node{1\quad \times} (e4)+(-2,0) node{e^{2t}} (e5)+(-2,0) node{e^{-2t}} ; \path (e3)--(e4) coordinate[midway] (X) (X)--+(-3,0) coordinate (A) (X)--+(4,0) coordinate (B) (e1)+(-1.5,.3) coordinate (C) (e5)+(-1.5,-.3) coordinate (D) ; \draw[magenta] (A)--(B) (C)--(D); \end{tikzpicture} \end{document}  PS: If you have better calculating scheme, please share! Update: It's my blackboard-chalk style in teaching, not in writing textbooks. I find that it is easier for students. The situation in the question is from answers of a final ODE examination. https://www.overleaf.com/read/srpbvhvddzwx • Not an answer, really, but I do not see the point of using some scheme for this. Why not just write things out? Something like this. Commented Dec 29, 2022 at 9:08 • @mickep It's my blackboard-chalk style in teaching. Please see my update. Commented Dec 29, 2022 at 15:36 ## 1 Answer A possible alternative with tabularray: \documentclass{article} \usepackage{amsmath} \usepackage{xcolor} \usepackage{tabularray} \begin{document} \[ \begin{tblr}{colspec={rrrcl}, vline{3} = {magenta}, hline{4} = {magenta}, column{1} = {font={\color{magenta}}, rightsep=0pt}, column{2} = {font={\color{magenta}}, leftsep=0pt, rightsep+=4pt}, column{3} = {leftsep+=4pt, rightsep=0pt}, column{4} = {colsep=2pt}, column{5} = {leftsep=0pt}, row{3} = {belowsep+=4pt}, row{4} = {abovesep+=4pt} } 6 & \times & y^* & = & Ate^{2t}+Be^{-2t}\\ -5 & \times & (y^*)' & = & A(1+2t)e^{2t}-2Be^{-2t}\\ 1 & \times & (y^*)''& = & A(4+4t)e^{2t}+4Be^{-2t}\\ &e^{2t} &1 & = & 4A-5A=-A\\ &e^{-2t} & 1 & = & 4B+10B+6B=20B\\ \end{tblr}
\end{document}


• Thank you for a nice solution (hline, vline) with tabularray. I have a quick look at its documentation, and be impressive with some features like linking with booktabs, ... mirror.kku.ac.th/CTAN/macros/latex/contrib/tabularray/… Commented Dec 29, 2022 at 15:49