Writing Differential Equations in LaTeX

LaTeX is very useful for doing maths assignments, preparing reports and thesis. I made report in  LaTeX during my six weeks training. Today I tried to write the solution of a differential equation in   LaTeX.

The main things used in it are:

Fractions : These can be written as:


Subscripts: These are wriiten as


here 1 is subscript of C

Differential Equation:


\frac{du}{dt} and \frac{d^2 u}{dx^2}

Partial Differential Equation:


\[ \frac{\partial u}{\partial t}
   = h^2 \left( \frac{\partial^2 u}{\partial x^2}
      + \frac{\partial^2 u}{\partial y^2}
      + \frac{\partial^2 u}{\partial z^2} \right) \]

Summation Sign




\[ \sum_{k=1}^n k^2 = \frac{1}{2} n (n+1).\]



\[ \int_a^b f(x)\,dx.\]

I thin its enough for writing a maths assignment.

Here is the file that I have tried.

\title{Equation-Writing in Latex}
\author{Priyanka Kapoor}
\usepackage{amsmath} % allows you to put text in the math environment.

\section{Linear Differential Equation}
\[ \frac{d^2w}{dx^2} - \frac{4u^2w}{l^2}
   = \frac{-qlx}{2D}+\frac{qx^2}{2D}  \]
Here u, l, q, D are constants.\
Auxiary Equation is \
\[ D^2-\frac{4u^2}{l^2}w=0 \]
\[ (D+\frac{2u}{l})(D-\frac{2u}{l})=0 \]
\[ D=\frac{-2u}{l},\frac{2u}{l} \]
So C.F is\
 \[ C_1e^\frac{-2ux}{l} +C_2 e^\frac{2ux}{l} \]
 \[ C_1cosh(\frac{2u}{l})x \]
  Because \[cosh(x) = \frac{e^-x + e^x}{2} \]
  Now Particular Integral (P. I) is
   \[ PI=\frac{1}{(D^2-\frac{4u^2}{l^2})} (\frac{-qlx}{2D}+\frac{qx^2}{2D}) \]
   \[ = \frac{-q}{2D}\frac{1}{(D^2-\frac{4u^2}{l^2})}(lx-x^2)\]

     \[ = \frac{-ql}{2D}\frac{1}{(D^2-(\frac{2u}{l})^2)}x  + \frac{q}{2D}\frac{1}{(D^2-(\frac{2u}{l})^2)}x^2 \]
     Taking 4u\^2/l\^2 common from denominator \
     \[ = \frac{-ql}{2D}\frac{l^2}{-4u^2}(1+\frac{-l^2D^2}{4u^2})^-1 +\frac{q}{2D}\frac{l^2}{-4u^2}(1+\frac{-l^2D^2}{4u^2})^-1 \]
     Solving binomial as it is of the form \[(1-x)^-1=1+x^2+x^3+ ... \]
   \[ = \frac{ql^3}{8Du^2} (1+ \frac{l^4D^4}{16u^4}+ ...)x + \frac{-ql^2}{8Du^2} (1+ \frac{l^4D^4}{16u^4}+ ...)x^2 \]
   \[ = \frac{ql^3x}{8Du^2} - \frac{ql^2x^2}{8Du^2} \]
   Solution of Differential Equation is \
   C. S = A. E + P. I
   \[w = C_1cosh(\frac{2u}{l})x + \frac{ql^3x}{8Du^2} - \frac{ql^2x^2}{8Du^2} \]

Give the commands

$pdfatex DE.tex
$evince DE.pdf

The PDF fiLe produced is

Happy writing with LaTeX 🙂


About Priyanka Kapoor

Simple, Hardworking & friendly.....
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s