\chapter{Relevant electromagnetic theory}
\label{appendix_maxwell}

\section{Maxwell's and Lorentz's equations}

The following four equations give a complete (non-quantum\footnotemark{})
description of the electric ($\E$) and the magnetic field ($\B$), in terms of
charge ($\rho$) and current distributions ($\J$) and the mutual interactions
of $\E$ and $\B$ over time.

\footnotetext{At very small scales and very high field strengths (that are
not relevant in neuroscience), the more general theory of quantum
electrodynamics is needed.}

\begin{align}
\div{\E} &= \frac{\rho}{\epsilon_0} \\
\curl{\E} &= -\pdv{\B}{t} \\
\div{\B} &= 0 \\
\curl{\B} &= \frac{1}{c^2} \qty( \pdv{\E}{t} + \frac{\J}{\varepsilon_0} )
\end{align}
%
$\varepsilon_0 \approx \SI{10}{\pF\per\m}$ is the distributed capacitance of
free space, and $c \approx \SI{3e8}{\m\per\s} = \SI{300}{\GHz\mm}$ is the
speed at which changes in $\E$ and $\B$ propagate. (For an intuitive explanation of the $\div$ and $\curl$ notation, see \cref{sec:div_curl}).

% The first equation means that the electric field emanating from a tiny region of space is proportional to the amount of charge inside that region

One additional equation, the Lorentz force law, completes the description of
classical electromagnetism. Whereas Maxwell's equations describe the fields
as caused by matter, Lorentz's equation describes the influence of the fields
on matter. Namely, a charged particle with velocity $\vb{v}$ and charge $q$
experiences the following force:
\begin{equation}
\F = q \qty(\E + \vb{v} \cross \B)
\end{equation}

Mobile charges and the electric and magnetic fields therefore interact with
each other through feedback. This results in often very complex charge
movements and field dynamics, until a steady state is reached.

\section{Statics}

When the time derivatives in Maxwell's equations are negligible, the electric and magnetic field become decoupled. The four equations then reduce to the governing equations for electrostatics:
%
\begin{align}
\div{\E} &= \frac{\rho}{\epsilon_0} \\
\curl{\E} &= 0,
\end{align}

and for magnetostatics:
%
\begin{align}
\div{\B} &= 0 \\
\curl{\B} &= \frac{\J}{c^2 \varepsilon_0}.
\end{align}

\section{Electric field potential}
\label{sec:appendix_potential}

The relationship between the electric field $\E(\loc,t)$ and the electric potential $\phi(\loc,t)$ is as follows. The electric potential difference between two points $\loc_a$ and $\loc_b$ is the negative line integral of the electric field along any curve connecting these two points (where $\dd{\s}$ is a tiny vector lying along the curve):
%
\begin{equation}
\phi(\loc_a,t) - \phi(\loc_b,t)
    = - \int_{\loc_a}^{\loc_b} \E(\loc,t) \vdot \dd{\s}
\end{equation}
%
An equivalent and arguably more elegant definition is the following. The electric field is the negative spatial gradient of the electric potential:
%
\begin{equation}
\label{eq:potential_gradient}
\E(\loc,t) = -\grad{\phi(\loc,t)},
\end{equation}
%
i.e. the electric field points from locations of high potential to locations of lower potential.

From \cref{eq:potential_gradient}, it is clear that the electric potential is only defined up to a constant (and that therefore only the electric potential \emph{difference} between two points is absolutely defined). We can easily define an absolute potential $\phi(\loc,t)$ however by fixing the voltage at a certain reference point. It makes sense to shift the electric potential such that it is zero for a reference point with no charges around (neither positive or negative); or equivalently, when the charges around this point balance each other out. (This is also what physicists do when they define the absolute electric potential at some point as the line integral of the electric field from that point to infinity, where it is implicitly assumed that infinity is uncharged).

\section{Divergence and curl}
\label{sec:div_curl}

\subsection{Divergence}

The divergence of a vector field at a certain point, $\div{\F}$, is a scalar
value that measures the net flow of $\F$ out of ($+$) or into ($-$) a very
small volume centered on this point.

This net flow or `flux' $\varphi$ of the field $\F$ through a volume $V$ is
the sum of individual flows through the surface of the volume. To calculate
this sum, the bounding surface $S$ of the volume is divided into small
surface patches $\dd{A}$. When the outward-pointing normal vector on such a
surface patch is denoted by $\n$, the flow through this patch $\dd{A}$ can be
written as $\F \cdot \n$. When the field vector $\F$ and the normal vector
$\n$ point in the same direction, the field is flowing out of the volume at
that location, and this inner product is positive. When they point in
opposite directions, the field is flowing into the volume, and the product is
negative.

Symbolically, this is summarised as:
\[
\varphi = \iint_S{\F \cdot \n \dd{A}},
\]

The divergence is then simply this flux for a very small volume $V$, and
normalised by the size of the volume, $\abs{V}$:
\[
\div{\F} = \lim_{\abs{V} \to 0}{\frac{\varphi}{\abs{V}}}
\]

\subsection{Curl}

The curl $\curl{\F}$ of a vector field is a similarly intuitive measure, in
the limit for small surfaces. In contrast with divergence however, the curl
of a three-dimensional vector field at some point is not a scalar, but a
three-dimensional vector. (In two dimensions however, the curl is a
scalar)\footnote{This is because rotations in 2D are fully described with one
number, while in 3D, curiously, three numbers are needed to fully describe
them}. We define one component of the curl, along one coordinate axis
$\xhatv$. The definitions for the other two coordinate axes are analogous.

The curl $\qty(\curl{\F}) \cdot \xhatv$ of a vector field at a certain point
and along the axis $\xhatv$, is a scalar value that measures the rotation of
$\F$, or the net flow of $\F$ along a small loop, around $\xhatv$. This loop
must lie in a plane that is perpendicular to the $\xhatv$ axis and that goes
through the point where the curl is measured. The curl along $\xhatv$ is
positive when the net flow along this loop is counterclockwise, and negative
when it is clockwise.

Let the loop be a closed path $C$ that encloses a planar surface $A$. The
loop $C$ is divided in many counterclockwise-oriented vectors $\dd{\vb{l}}$.
The rotation or net flow $O$ of $\F$ along the loop $C$ is then:
\[
O = \int_C{\F \cdot \dd{\vb{l}}}
\]

The curl in the $\xhatv$ direction is then this net loop flow, for a very
small loop and normalised by the size of the enclosed surface, $\abs{A}$:
\[
\qty(\curl{\F}) \cdot \xhatv = \lim_{\abs{A} \to 0}{\frac{O}{\abs{A}}}
\]

% \section{Macroscopic formulation}

% Here, we divide charges between free and bound:
% Q = Q_b + Q_f
% \rho = \rho_b + \rho_f

% The bound charge is most conveniently described in terms of the polarization P(r,t) of the material, its dipole moment per unit volume.
% % If P is uniform, a macroscopic separation of charge is produced only at the surfaces where P enters and leaves the material. For non-uniform P, a charge is also produced in the bulk.
% % Nunez: "In tissue Pc [our P] is due mainly to membrane charge, which is much larger than the molecular and atomic charge effects common to physical materials."

% Displacement field D (like E, but only due to free charges):
% D(r,t) = eps_0 E(r,t) + P(r,t)

% For linear, isotropic materials without additional polarisation
% ("constitutive law"):
% D(r,t) = eps E(r,t)

% permittivity (distributed capacitance):
% eps = eps_r eps_0
% kappa = eps_r = eps / eps_0  (relative dielectric constant)

% In anisotropic material, eps is a matrix.
% In a nonlinear material, eps depends on the strength of the field.

% The very complicated and granular bound charges and bound currents, therefore, can be represented on the macroscopic scale in terms of P and M, which average these charges and currents on a sufficiently large scale so as not to see the granularity of individual atoms, but also sufficiently small that they vary with location in the material.


\chapter*{Notation}

We suggest to settle some notational issues as follows.
\begin{enumerate}
\item input data variables
  \begin{equation}
    \label{eq:1}
x, \quad y
  \end{equation}
In MgNet paper we keep using $f$ for data to match the notation
with the PDE since this is a special case.
\item number of dimension of the input data
  \begin{equation}
    \label{dim}
d, \quad x\in \mathbb R^d
  \end{equation}
\item the weights
  \begin{equation}
    \label{weights}
Wx+b; W\in\mathbb R^{\kappa\times d}, b\in \mathbb R^\kappa,
\theta=(W,b)\in\mathbb R^{\kappa\times(d+1)}
\end{equation}
\item number of classification class:
  \begin{equation}
    \label{k} \kappa
  \end{equation}
\item Number of iterations
  \begin{equation}
    \label{iterations}
t
  \end{equation}
such as
$$
\theta^{t+1}=\theta^t-\eta_t \nabla f_{i_t}(\theta^t)
$$
\item Learning rate
  \begin{equation}
    \label{learningrate}
\eta
  \end{equation}

\item independent variables for optimization algorithm
for general optimizations, use x,y, like
$$
x^*=\arg\min_{x}f(x)
$$
and
$$
f(y)\ge f(x)+\nabla f(x)\cdot (y-x)
$$
When the problem involves deep learning or machine learning  models, use $\theta$
$$
\theta^*=\arg\min_{\theta}f(\theta)
$$
\begin{remark}
In RDA, we will use w instead.
\end{remark}

\end{enumerate}


\documentclass[12pt,english]{article}

\usepackage[colorlinks=true, linkcolor=blue, citecolor=blue, plainpages=false, pdfpagelabels=true, urlcolor=blue]{hyperref}
\usepackage[bottom]{footmisc}

\newtheorem{theorem}{Theorem}[section]
\newtheorem{corollary}{Corollary}[theorem]
\newtheorem{assumption}{Assumption}[section]

\newtheorem{proposition}{Proposition}
\newtheorem{definition}{Definition}

\usepackage{blindtext}

\usepackage{mathtools}
\usepackage{bm}

\begin{document}

\title{Math Testing}
\author{\href{http://fanwangecon.github.io/}{Fan Wang} \thanks{See \href{https://fanwangecon.github.io/Tex4Econ/}{Tex4Econ} for more latex examples.}}

\maketitle

\section{Discrete Allocations}

\subsection{Binary Allocation}

Theorems in each section and corollaries follow section numbering. See \href{https://www.overleaf.com/learn/latex/Theorems_and_proofs}{theorems and proofs}

\subsubsection{Allocation Space}

\begin{assumption}
    \label{as:1a}
    \begin{align}
         f(x)  &= a x^2+b x +c   &   g(x)  &= d x^3 \\
         f'(x) &= 2 a x +b       &   g'(x) &= 3 d x^2
    \end{align}
    \end{assumption}

\blindtext

\subsubsection{Optimal Targeting Queue}

\begin{theorem}
\label{thm:1a}
\blindtext
\begin{align}
    f(x) &= (x+a)(x+b) \\
         &= x^2 + (a+b)x + ab
\end{align}
\blindtext
\end{theorem}

\blindtext

\subsubsection{Special Cases}

\begin{corollary}
\label{corr:1a}
$$x^n + y^n = z^n$$
\blinditemize
\end{corollary}

\begin{corollary}
\label{corr:1b}
\[
 f(x) = \begin{dcases*}
        x  & when $x$ is even\\
        -x & when $x$ is odd
        \end{dcases*}
\]
\end{corollary}

\subsection{Discrete Allocations}

\subsubsection{Discrete Allocation Space}

\begin{assumption}
\label{as:1b}
\begin{equation}
 \boxed{x^2+y^2 = z^2}
\end{equation}
\end{assumption}

\subsubsection{Optimal Targeting Discrete Queues}

\begin{theorem}
\label{thm:1b}
\blinddescription
\begin{alignat}{2}
 \sigma_1 &= x + y  &\quad \sigma_2 &= \frac{x}{y} \\
 \sigma_1' &= \frac{\partial x + y}{\partial x} & \sigma_2'
    &= \frac{\partial \frac{x}{y}}{\partial x}
\end{alignat}
\end{theorem}

\blindtext

\section{Continuous Allocations}

\blindtext

\subsection{Lower Bounded Continuous Allocations}

\subsubsection{Allocation Space}

\blindtext

\begin{assumption}
\label{as:2a}
\[
 u(x) =
  \begin{cases}
   \exp{x} & \text{if } x \geq 0 \\
   1       & \text{if } x < 0
  \end{cases}
\]
\end{assumption}

\subsubsection{Tageting Queues}

\begin{theorem}
\label{thm:2a}
\blindenumerate
\[
\lim_{x\to 0}{\frac{e^x-1}{2x}}
\overset{\left[\frac{0}{0}\right]}{\underset{\mathrm{H}}{=}}
\lim_{x\to 0}{\frac{e^x}{2}}={\frac{1}{2}}
\]
\blindtext
\end{theorem}

\subsubsection{Special cases}

\begin{corollary}
\label{corr:2a}
\[
z = \overbracket[3pt]{
		\underbracket{x}_{\text{real}} +
		\underbracket[0.5pt][7pt]{iy}_{\text{imaginary}}
		}^{\text{complex number}}
\]
\blinditemize
\end{corollary}

\subsection{Lower and Upper Bounded Continuous Allocations}
\begin{theorem}
\label{thm:2b}
\begin{gather}
 a \xleftrightarrow[under]{over} b\\
%
 A \xLeftarrow[under]{over} B\\
%
 B \xRightarrow[under]{over} C\\
%
 C \xLeftrightarrow[under]{over} D\\
%
 D \xhookleftarrow[under]{over} E\\
%
 E \xhookrightarrow[under]{over} F\\
%
 F \xmapsto[under]{over} G\\
\end{gather}
\end{theorem}

\end{document}


\chapter{Differential Equations}
In physics we encounter differential equations all the time. In fact the whole programme of classical mechanics is to develop a second order differential equation using Newton's laws of motion and then solving it.\\Sometimes these are ordinary
differential equations in one variable (abbreviated ODEs). More often the equations are
partial differential equations (PDEs) in two or more variables. Simply we can say , differential equations is a relation between a function and its derivatives.
\begin{definition}
	A differential equation is an equation which involves independent and dependent variables and their derivatives or differentials.
\end{definition}
\begin{example}
	\hspace{1cm}
\begin{itemize}
		\item $\frac{dy}{dx}={4x-2}$
		\item $\frac{d^{2}y}{dx^{2}}=5\frac{dy}{dx}+10$
		\item $(1+\frac{dy}{dx})^{3}=k\frac{dy}{dx}$
		\item $\frac{dy}{dx}+xy=x^{3}y^{3}$
		\item $\frac{\partial^{2}y}{\partial^{2} x}=\frac{1}{c^{2}} \frac{\partial^{2}y}{\partial^{2} x} $
		\item $\frac{\partial u}{\partial t}=\frac{\partial u}{\partial x}+\frac{\partial u}{\partial y}$
	\end{itemize}
\end{example}
\section{{Types of differential equation}}
There are mainly two types of differential equations,
	\begin{itemize}
	\item \textbf{Ordinary differential equations.}\par A differentnial equation involving derivatives with respect to a single variable is called an ordinary differential equation.
	\\\\
	\textbf{General form:} $\frac{d y}{d x}=f(x, y)=-\frac{P(x, y)}{Q(x, y)}$
	\begin{example}
		\begin{align*}
		F&=m\frac{d v}{dt}\\
		\frac{dy}{dx}+x&= 1
		\end{align*}
	\end{example}
	\item \textbf{Partial differential equations.}\par A differential equation involving partial derivatives with respect to more than one independent variable is called a partial differential equation.
	\begin{example}
		\begin{align*}
		\intertext{\textbf{Poisson's equation:}}
		\nabla^{2}\psi&= \frac{\rho}{\epsilon_{0}}\\
		\left( \frac{\partial ^{2}}{\partial x^{2}}+\frac{\partial ^{2}}{\partial y^{2}}+\frac{\partial ^{2}}{\partial z^{2}}\right)\psi &= \frac{\rho}{\epsilon_{0}}\qquad (\text{In cartesian coordinate system.})
		\intertext{\textbf{Schrodinger Equation:}}
		\left(-\frac{h^{2}}{2 m} \nabla^{2}+V\right) \psi&=i \hbar \frac{\partial \psi}{\partial t}
		\end{align*}
	\end{example}
	\end{itemize}
\section{Order and Degree of a differential equation}
\textbf{Order:}\\The order of a differential equation is the highest differential in the equation.\\\\
\textbf{Degree:}\\The degree of a differential equation is the power of the highest differential in the equation.
\begin{example}
	\hspace{0.5cm}
	\begin{itemize}
		\item $\left(\frac{\partial^{2} y}{\partial x^{2}}\right)^{2}+\left(\frac{\partial y}{\partial x}\right)-\left(\frac{\partial^{3} y}{\partial x^{3}}\right)=x y$\hspace{0.5cm}Order=2 ,Degree=2
		\item   $ L \frac{d^{2} q}{d t^{2}}+R \frac{d q}{d t}+\frac{q}{c}=E \sin \omega t$\hspace{1cm}Order=2 ,Degree=1
		\item $\frac{dy}{dx}+xy=x^{3}y^{3}$ \hspace{2.7cm}Order=1 ,Degree=1
		\item $\left(\frac{\mathrm{d}^{2} \mathrm{y}}{\mathrm{d} \mathrm{x}^{2}}\right)^{3}=\left[1+\left(\frac{\mathrm{dy}}{\mathrm{dx}}\right)^{4}\right]^{5}$
	 \hspace{1.1cm} Order=2 ,Degree =3
	 \item $\frac{d^{3} y}{d x^{3}}-\left(\frac{d y}{d x}\right)^{\frac{1}{2}}=0$ \hspace{2.3cm} Order=3 ,Degree=2
	\end{itemize}
\end{example}
\begin{exercise}
Find the order and degree of the given differential equations,

\begin{enumerate}
	\item $\frac{d^{3} y}{d x^{3}}-\left(\frac{d y}{d x}\right)^{\frac{1}{2}}=0$
	\item $\left[1+\frac{d^{2} y}{d x^{2}}\right]^{\frac{3}{2}}=a \frac{d^{2} y}{d x^{2}}$
\end{enumerate}
\end{exercise}
\begin{answer}\hspace{0.5cm}
\begin{enumerate}
	\item Here we need to eliminate the radical sign.
	For this write the equation as
	\\\begin{align*}
	\frac{d^{3} y}{d x^{3}}&=\left(\frac{d y}{d x}\right)^{\frac{1}{2}}\\\text{ Squaring both sides, we get  }\\\left(\frac{d^{3} y}{d x^{3}}\right)^{2}&=\frac{d y}{d x}\\
	\therefore \quad  \text{Order} =3,\text{degree} =2
	\end{align*}
	\item Here we eliminate the radical sign. For this write the equation as

   \begin{align*}
	\left[1+\frac{d^{2} y}{d x^{2}}\right]^{\frac{3}{2}}&=a \frac{d^{2} y}{d x^{2}}
	\\\text{ Squaring both sides, we get  }\\\left[1+\frac{d^{2} y}{d x^{2}}\right]^{3}&=a^{2}\left(\frac{d^{2} y}{d x^{2}}\right)^{2}\\
	\therefore \quad  \text{Order} =2,\text{degree} =3
	\end{align*}
\end{enumerate}
\end{answer}
\begin{note}
The direction of a curve at a particular point is given by the tangent line at that point and the slope of the tangent is given by $\frac{dy}{dx}$ at that point.
\end{note}
\section{First order differential equation}
An equation of the general form
$$
\frac{d y}{d x}=-\frac{f(x, y)}{g(x, y)}
$$
Is said to be a first order differential equation.The equation contains first and no higher derivatives. The only derivative here $\frac{d y}{d x}$ is a total or ordinarry derivative not a partial one.
\section{Geometrical meaning of First order First degree differential equations}
\begin{wrapfigure}{r}{0.5\textwidth}
	\begin{center}
		\includegraphics[width=0.25\textwidth]{03-crop}
	\end{center}
	\caption{Geometrical meaning of Differential equation}
\end{wrapfigure}
The solution of every  first order first degree differential equations represent a family of curves.
\\\\Let, $f\left(x, y, \frac{d y}{d x}\right)=0$\quad  represents a differential equation of  first order and first degree.\\\\
Taking $A\left(x_{0}, y_{0}\right)$ as an initial point,we
can find $\frac{d y}{d x}$ at $A\left(x_{0}, y_{0}\right)$. And with the help of that we can draw the tangent at the point $A$.\\\\
On the tangent line take a neighbouring point $B\left(x_{1}, y_{1}\right)$. Find $\frac{d y}{d x}$ at the point $B\left(x_{1}, y_{1}\right)$and draw the tangent at $B$. And in this way draw another tangent at the point $C$ on the tangent line $B$ . Similarly draw, some more tangents by taking the neighbouring points on them. Again we take another starting point $A^{\prime}\left(x_{0}^{\prime}, y_{0}^{\prime}\right)$. We can draw another curve starting from
$A^{\prime} .$ In this way we can draw a number of curves. They form a smooth curve. \\
That is the given difrential equation represents a family of curves.

\section{Solution of a differential equation}
A solution of a differential equation is any relation
between variables which is free of derivatives and which
satisfies the differential equation.\\\\
\textbf{General solution:}\\ A general solution is the solution in which the number
of arbitrary constants and the order of the differential
equation are same.\\\\
\textbf{Particular solution:}\\ A particular solution is the solution which can be
obtained by giving particular values to arbitrary constants of general solution.

\section{Solution of First order differential equations}
The solutions of first order differential equations are obtained by various methods,
\section{ Method of seperation of variables}
If all functions of $x$ and $d x$ can be arranged on one side and $y$ and $d y$ on the other side, then the variables are separable. The solution of this equation is found by integrating the functions of $x$ and $y$.
$$f(x) d x=g(y) d y\Longrightarrow
\int f(x) d x=\int g(y) d y+C
$$
\textbf{\large Method of solving:}
\begin{enumerate}
	\item  Separate the variables as $f(x) d x=g(y) dy$.
    \item Integrate both sides as $\int f(x) d x=\int g(y) d y$.
    \item  Add an arbitrary constant $C$ on R.H.S.
\end{enumerate}
\begin{exercise}
Solve	$\cos (x+y) d y=d x$
\end{exercise}
\begin{answer}[H]
	\begin{align*}
		\cos (x+y) d y&=d x \\
		\frac{d y}{d x}&=\sec (x+y)\\
		\text{  Let, }x+y&=z\\
		\text{  Then, }1+\frac{d y}{d x}=\frac{d z}{d x} \quad & \Rightarrow \quad \frac{d y}{d x}=\frac{d z}{d x}-1 \\
		\frac{d z}{d x}-1=\sec z \quad &\Rightarrow \quad  \frac{d z}{d x}=1+\sec z\\
		\text{Separating the variables, we get, }\\\frac{d z}{1+\sec z}&=d x\\
		\text{On integrating,}\\
		\int \frac{\cos z}{\cos z+1} d z&=\int d x\\
		\int\left[1-\frac{1}{\cos z+1}\right] d z&=x+C \\
		\int\left[ 1-\frac{1}{2 \cos ^{2} \frac{z}{2}-1+1}\right]  d z&=x+C \\
		\int\left(1-\frac{1}{2} \sec ^{2} \frac{z}{2}\right) d z&=x+C\\
		\int\left(1-\frac{1}{2} \sec ^{2} \frac{z}{2}\right) d z&=x+C\\
		z-\tan \frac{z}{2}&=x+C  \\
		x+y-\tan \frac{x+y}{2}&=x+C\\
		 y-\tan \frac{x+y}{2}&=C
	\end{align*}
\end{answer}
\begin{exercise}
	Solve $e^{d y / d x}=(x+1) ;$ given $y=3$ at $x=0$
\end{exercise}
\begin{answer}
	Taking log of both sides we get,
	\begin{align*}
		\frac{d y}{d x}=\ln (x+1)\quad &\Rightarrow \quad d y=\ln (x+1) d x\\\text{on integration }, \\\int d y=\int 1 \cdot \ln (x+1) d x \quad &\Rightarrow \quad y=x \ln (x+1)-\int \frac{x}{(x+1)} d x+C\\
		y&=x \ln (x+1)-\int \frac{(x+1)-1}{(x+1)} d x+C\\ y&=x \ln (x+1)-\int \frac{(x+1)}{(x+1)} d x+\int \frac{1}{(x+1)} d x+C\\&=x \ln (x+1)-x+\ln (x+1)+C\\y&=(x+1) \ln (x+1)-x+C\\\text{Given: at,}\ x&=0 \quad y=3 \Rightarrow \quad C=3\\
		\text{Therefore,}\ y&=(x+1) \ln (x+1)-x+3
	\end{align*}

\end{answer}
\section{Solution of Homogeneous differential equation}
Homogeneous equations are of the form,
$$
\frac{d y}{d x}=\frac{f(x, y)}{g(x, y)}
$$
Where $f(x, y)$ and $g(x, y)$ are homogeneous functions of the same degree in $x$ and $y$. Homogeneous functions are those in which all the terms are of $n^{th}$  degree.\\\\
\textbf{\large Method of solving}
\begin{enumerate}
	\item  Put, $y=v x,$ then $\frac{d y}{d x}=v+x \frac{d y}{d x}$.
	\item  Separate $v$ and $x$ and then integrate.\\\\
	$
	\begin{aligned}
	 \frac{d y}{d x}&=f(y / x) \\
	\Rightarrow  \hspace{1.1cm}y / x&=v \\
	\Rightarrow \hspace{0.3cm}\frac{d v}{f(v)-v}&=\frac{d x}{x} \\
	\Rightarrow  \int \frac{d v}{f(v)-v}&=\log x+C
	\end{aligned}
	$
\end{enumerate}
\begin{exercise}
	Solve the differential equation $\left(x^{2}-y^{2}\right) d x+2 x y$ $d y=0,$ given that $y=1$ when $x=1$
\end{exercise}
\begin{answer}

	\begin{alignat*}{2}
		\left(x^{2}-y^{2}\right) d x+2 x y d y&=0\\
			\left(x^{2}-y^{2}\right) d x&=-2 x y d y \\
			\frac{d y}{d x}=-\frac{x^{2}-y^{2}}{2 x y}&=\frac{y^{2}-x^{2}}{2 x y}\\
			\text{Putting  } y=v x  \quad &\text{and} \quad \frac{d y}{d x}=v+x \frac{d v}{d x}\\
			\text{ We get}
			\quad v+x \frac{d v}{d x}&=\frac{v^{2} x^{2}-x^{2}}{2 x \cdot v x}\\
			\Rightarrow \hspace{2cm}\quad v+x \frac{d v}{d x}&=\frac{v^{2}-1}{2 v}\\
			\Rightarrow\hspace{2.7cm} x \cdot \frac{d v}{d x}&=\frac{v^{2}-1}{2 v}-v\\&=\frac{v^{2}-1-2 v^{2}}{2 v}\\&=-\left[\frac{v^{2}+1}{2 v}\right]\\
			\Rightarrow \hspace{1.5cm}\quad \frac{2 v}{v^{2}+1} \cdot d v&=-\frac{d x}{x}, \quad x \neq 0\\
			\Rightarrow \hspace{1.1cm}\quad \int \frac{2 v}{v^{2}+1} \cdot d v&=-\int \frac{d x}{x}\\
			\Rightarrow \hspace{1.3cm}\quad \log \left(v^{2}+1\right)&=-\log |x|+c\\
			\Rightarrow \quad \log \left(v^{2}+1\right)+\log |x|&=\log c\\
			\Rightarrow \hspace{1.5cm}\quad\left(v^{2}+1\right)|x|&=c\\
			\text{Now, putting }v&=y / x\\
			\left(y^{2} / x^{2}+1\right)|x|&=c \\
			\Rightarrow \left(x^{2}+y^{2}\right)&=c|x|\\\text{	Which is similar to } x=1 \quad \text{and} \quad y=1, \text{we get,}c&=2\\\text{Putting value of} \quad c&=2 ,\text{We get}\\x^{2}+y^{2}&=2 x \text { or } x^{2}+y^{2}=2(-x)\\x=1 &\quad \text{and}\quad y=1 \\\text{Do not satisfy}\quad x^{2}+y^{2}&=2(-x) \\\text{Hence,}\quad x^{2}+y^{2}&=2 x \quad \text{is the required solution.}
	\end{alignat*}
\end{answer}

\subsection{Equations reducible to homogeneuos form}
Let a differential equation be,
$$
\frac{d y}{d x}=\frac{a x+b y+c}{A x+B y+C}
$$
\textbf{Type-1}\\

\begin{align*}
\text{If, in the above equation,}\quad\frac{a}{A}&\neq\frac{b}{B}\\\text{Then we can substitute}\quad x=X+h\quad&,\quad y=Y+k,\text{($h, k$ being constants)}\\
\text{The given differential equation reduces to}\\
\frac{d Y}{d X}&=\frac{a(X+h)+b(Y+k)+c}{A(X+h)+B(Y+k)+C}\\&=\frac{a X+b Y+a h+b k+c}{A X+B Y+A h+B k+C}\\
\text{Choose $h, k$ so that} \quad a h+b k+c&=0\\
A h+K k+C&=0\\
\text{Then the given equation becomes homogeneous}\\\frac{d Y}{d X}&=\frac{a X+b Y}{A X+B Y}
\end{align*}
\textbf{Type-2}\\
\begin{align*}
\text{If}\ \frac{a}{A}&=\frac{b}{B},\\
\text{Then the value of $h, k$ will not be finite.}\\
\frac{a}{A}&=\frac{b}{B}=\frac{1}{m}\\
A=a m\quad, \quad B&=b \mathrm{~m}\\
\text{The given equation becomes}\quad\frac{d y}{d x}&=\frac{a x+b y+c}{m(a x+b y)+C}
\end{align*}
 Now put $a x+b y=z$ and apply the method of variables separable.
 \begin{exercise}
 	Solve $(x+2 y)(d x-d y)=d x+d y$
 \end{exercise}
\begin{answer}
	\begin{align*}
	(x+2 y)(d x-d y)&=d x+d y \\\Rightarrow(x+2 y-1) d x-(x+2 y+1) d y&=0\\
	\Rightarrow  \frac{d y}{d x}&=\frac{x+2 y-1}{x+2 y+1}\\
	\text { Let } x+2 y&=z \\ 1+2 \frac{d y}{d x}&=\frac{d z}{d x} \\ \frac{d z}{d x}&=\frac{3 z-1}{z+1}\quad  (\text{Since, $ \frac{d y}{d x}=\frac{x+2 y-1}{x+2 y+1}$})\\
	\int \frac{z+1}{3 z-1} dz &=\int dx\\
	\text{L.H.L}&=\int \frac{z+1}{3 z-1} dz\\
	\intertext{multiply numerator and denominator by 3, we get, }
		\text{L.H.L}&=\int \frac{1}{3} \frac{(3z+3)}{(3 z-1)} dz\\
		&=\int \frac{1}{3} \frac{(3z-1+4)}{(3 z-1)} dz\\
		&=\int \frac{1}{3} \frac{(3z-1)+4}{(3 z-1)} dz\\
		&=\int \frac{1}{3}\left\lbrace  \frac{(3z-1)}{(3 z-1)}+ \frac{4}{(3 z-1)}\right\rbrace dz\\
		&=\int \left\lbrace  \frac{1}{3}+  \frac{1}{3} \frac{4}{(3 z-1)}\right\rbrace dz\\
		&=\int \left\lbrace  \frac{1}{3}+  \frac{4}{9} \frac{1}{(3 z-1)}\right\rbrace dz\\
		&=\frac{1}{3} z+\frac{4}{9} \ln (3 z-1)+c
		\intertext{Then,}
		\int \frac{z+1}{3 z-1} dz &=\int dx \Rightarrow	\quad
		\frac{1}{3} (x+2y)+\frac{4}{9} \ln (3 x+6 y-1)=2x+c\\
		3 x-3 y+a&=2 \ln (3 x+6 y-1)\\
		4 \ln (3 x+6 y-1)&=(6 x-6y)+c\\
	2 \ln (3 x+6 y-1)&=(3 x-3y)+c\\
\end{align*}
\end{answer}
\section{Linear equation of first order}
If a differential equation has its dependent variables and its derivatives occur in the first degree and are not multiplied together, then the equation is said to be linear. The standard equation of a linear equation of first order is given as
$$
\frac{d y}{d x}+P y=Q
$$
Where $P$ and $Q$ are functions of $x$.

\begin{align*}
\text { Integrating factor }&=(\text { I.F. })=e^{\int P \cdot d x} \\
\Rightarrow y \cdot e^{\int P \cdot d x}&=\int Q \cdot e^{\int P \cdot d x} d x+C \\
\Rightarrow \hspace{0.3cm}y(\mathrm{I.F.})&=\int Q(\mathrm{I.F.}) d x+C\\
\end{align*}

\begin{exercise}
	Solve the differential equation $\frac{d y}{d x}-\frac{y}{x}=2 x^{2}, x>0$.
\end{exercise}
\begin{answer}
	we know,

	\begin{align*}
		\frac{d y}{d x}+\left(\frac{-1}{x}\right) y &=2 x^{2}\\
		\frac{d y}{d x}+P y=Q, \text { where } P &=-\frac{1}{x} \text { and } Q=2 x^{2}\\
		I.F&=e^{\int P \cdot d x}=e^{\int-1 / x \cdot d x}\\&=e^{-\log x}=e^{\log x^{-1}}=x^{-1}=\frac{1}{x}\\
		\text{Multiplying both sides with $I.F$, we get}\\\frac{1}{x} \cdot \frac{d y}{d x}-\frac{1}{x^{2}} \cdot y&=2 x\\
		\text{Integrating both sides w.r.t. $x,$ we get}\\y \cdot\left(\frac{1}{x}\right)&=\int 2 x \cdot d x+C \\
		\Rightarrow \quad y \cdot \frac{1}{x}&=x^{2}+C\\\Rightarrow\hspace{0.9cm} y&=x^{3}+C x, x>0 \quad \text{is the required solution.}
	\end{align*}
\end{answer}
\subsection{Equations reducible to linear form}
The differential equation of the form,
$$\frac{dy}{dx}+p(x)y=f(x)y^{n}$$is called the Bernoulli's equation or equation reducible to linear form.
It can be done by dividing by $y^{n}$ and substituting $\frac{1}{y^{n-1}}=z$
\begin{alignat*}{2}
&\frac{1}{y^{n}} \frac{d y}{d x}+\frac{1}{y^{n-1}} P&&=Q\\&\text{Put}\quad \frac{1}{y^{n-1}}&&=z\\&\frac{(1-n)}{y^{n}} \frac{d y}{d x}&&=\frac{d z}{d x} \\ &\Rightarrow \quad \frac{1}{y^{n}} \frac{d y}{d x}&&=\frac{d z}{1-n}\\
&\frac{1}{1-n} \frac{d z}{d x}+P z&&=Q \quad \text{or}\\& \frac{d z}{d x}+P(1-n) z&&=Q(1-n)
\end{alignat*}
Which is a linear equation and can be solved easily.
\begin{exercise}
	Solve $\frac{d y}{d x}+x y=x^{3} y^{3}$
\end{exercise}
\begin{answer}We have,
	\begin{align*}
\frac{d y}{d x}+x y&=x^{3} y^{3}\\
\frac{1}{y^{3}} \frac{d y}{d x}+\frac{x}{y^{2}}&=x^{3}\\
	\text{putting}\quad \frac{1}{y^{2}}&=z \\\Rightarrow \quad \frac{-2}{y^{3}} \frac{d y}{d x}&=\frac{d z}{d x} \quad \Rightarrow \quad \frac{1}{y^{3}} \frac{d y}{d x}=\frac{-1}{2} \frac{d z}{d x}\\\therefore \quad-\frac{1}{2} \frac{d z}{d x}+x z&=x^{3} \qquad\Rightarrow \quad \frac{d z}{d x}-2 x z=-2 x^{3}\\
	\mathrm{\therefore I.F.}=e^{-\int 2 x d x}&=e^{-x^{2}}\\
	z e^{-x^{2}}&=-2 \int x^{3} e^{-x^{2}} d x\\
	\text{Let}\quad  -x^{2}&=t \Rightarrow-2 x d x=d t\\
	z e^{-x^{2}}&=\int t e^{t} d t=t e^{t}-e^{t}+c\\
	\text{put}\quad z=y^{-2} \text{and}\quad t=-x^{2}\\
	\therefore \frac{e^{-x^{2}}}{y^{2}}&=-x^{2} e^{-x^{2}}-e^{-x^{2}}+c\\
	\frac{1}{y^{2}}&=-x^{2}-1+C e^{x^{2}}
	\end{align*}
\end{answer}
\section{Exact differential equations}
A differential equation of the form , $Mdx+Ndy=0$ is said to be  exact if it satisfy the following condition,$$\frac{\partial \boldsymbol{M}}{\partial \boldsymbol{y}}=\frac{\partial N}{\partial \boldsymbol{x}}$$
$\frac{\partial M}{\partial \boldsymbol{y}}\quad-\quad$Differential co-efficient of $M$ with respect to $y$ keeping $x$ constant\\
$\frac{\partial N}{\partial \boldsymbol{x}}\quad-\quad$Differential co-efficient of $N$ with respect to $x$, keeping $y$ constant.\\\\
\textbf{\large Method of solving:}\\
\textbf{Step 1:} Integrate $M$ w.r.t. $x$ keeping $y$ constant\\
\textbf{Step 2:} Integrate w.r.t. $y$, only those terms of $N$ which do not contain $x$.\\ \textbf{Step 3:} Result of 1 + Result of 2 = Constant.
\begin{exercise}
	Solve $\left(x^{2}+2 x y\right) d x+\left(x^{2}+y^{2}\right) d y=0$
\end{exercise}
\begin{answer}
	\begin{align*}
	\text{Here,}\quad M=\left(x^{2}+2 x y\right) \quad &\text{and}\quad N=\left(x^{2}+y^{2}\right)\\\Rightarrow \frac{\partial M}{\partial y}&=2 x\\\text{and}\quad
	\frac{\partial N}{\partial x}&=2 x\\
	\text{Hence, the given equation is exact}\\
	\int\left(x^{2}+2 x y\right) d x+\int y^{2} d y&=c\\\frac{x^{3}}{3}+x^{2} y+\frac{y^{3}}{3}&=C\\\text { The solution is: } \\\int\left(x^{2}+2 x y\right) d x+\int y^{2} d y=c=\frac{x^{3}}{43}+x^{2} y+\frac{y^{3}}{3}&=6\end{align*}
\end{answer}
\subsection{Equations reducible to Exact form}
A differential equation which is not exact can be reduced to exact form  by multiplying it by a constant , here the integrating factor.\\
\textbf{Type 1:} If $ \frac{\frac{\partial M}{\partial y}-\frac{\partial N}{\partial x}}{N}\text { is a function of } x \text { alone, say } f(x), \text { then } \mathrm{I.F}=e^{\int f(x) d x}$\\
\textbf{Type 2:} If $\frac{\frac{\partial N}{\partial x}-\frac{\partial M}{\partial y}}{M}$ is a function of $y$ alone, say $f(y),$ then
$
\mathrm{I.F} =e^{\int f(y) d y}
$
\begin{exercise}
	Solve $(2 x \log x-x y) d y+2 y d x=0$
\end{exercise}
\begin{answer}
\begin{align*}
M &=2 y,\quad N=2 x \log x-x y\notag\\
\frac{\partial M}{\partial y}&=2,\quad\frac{\partial N}{\partial x}=2(1+\log x)-y\\
\text { Here, }\notag \\
\quad \frac{\frac{\partial M}{\partial y}-\frac{\partial N}{\partial x}}{N}&=\frac{2-2-2 \log x+y}{2 x \log x-x y}\\&=\frac{-(2 \log x-y)}{x(2 \log x-y)}=-\frac{1}{x}=f(x)\notag\\\text { I.F. }&=e^{\int f(x) d x}=e^{\int-\frac{1}{x} d x}\\&=e^{-\log x}=e^{\log x^{-1}}=x^{-1}=\frac{1}{x}\\
&\text{On multiplying the given differential equation by}  \frac{1}{x}, \text{we get}\\
\frac{2 y}{x} d x+(2 \log x-y) d y&=0 \\ \Rightarrow \quad \int \frac{2 y}{x} d x+\int-y d y&=c \\
\Rightarrow  \qquad\quad 2 y \log x-\frac{1}{2} y^{2}&=c
\end{align*}
\end{answer}
\section{Orthogonal trajectories and Family of curves}
Given a one-parameter family of plane curves, it's orthogonal trajectories are another
one-parameter family of curves, each one of which is perpendicular to all the curves in the
original family. For instance, if the original family consisted of all circles having center at the origin, it's orthogonal trajectories would be all rays (half-lines) starting at the origin.
\begin{definition}
	Two families of curves are such that every curve of either family cuts each curve of the other family at right angles. They are called orthogonal trajectories of each other.
\end{definition}
Orthogonal trajectories arise in different contexts in applications. If the
original family represents the lines of force in a gravitational or electrostatic field, its orthogonal trajectories represent the equipotentials, the curves along which the gravitational or electrostatic potential is constant.
\begin{example}\hspace{1cm}
	\begin{enumerate}
		\item The path of an electric field is perpendicular to equipotential curves.
		\item  In fluid flow, the stream lines and equipotential lines are orthogonal trajectories.
		\item The lines of heat flow is perpendicular to isothermal curves.
	\end{enumerate}
\end{example}
\subsection{Finding orthogonal trajectories to the curve}
Let a family of curves be given by the equation
$$
g(x, y)=C
$$
Where $C$ is a constant. For the given family of curves, we can draw the orthogonal trajectories, that is another family of curves $f(x, y)=C$ that cross the given curves at right angles.
\subsubsection{Method of solving}
\textbf{Family of curves given ,then to find orthogonal trajectories.}
\begin{enumerate}
	\item  By differentiating the equation of curves find the differential equations in the form $f\left(x, y, \frac{d y}{d x}\right)=0$
	\item  Replace $\frac{d y}{d x}$ by $-\frac{d x}{d y}$\\ ($ m_{1}m_{2}=-1$, where,$m_{1}$=given family,$m_{2}$=orthogonal  family)
	\item  Solve the differential equation of the orthogonal trajectories i.e., $f\left(x, y,-\frac{d x}{d y}\right)=0$
\end{enumerate}
\textbf{Orthogonal trajectories given , then to find Family of curves .}
\begin{enumerate}
	\item Solve the differential equation of the orthogonal trajectory $f\left(x, y,\frac{d x}{d y}\right)=0$ using appropriate method.
\end{enumerate}
\begin{note}
	\textbf{Self-orthogonal:}. If the family of orthogonal trajectory is the same as the given family of curves,then it's called self orthogonal.
\end{note}
\begin{exercise}
	 Find the orthogonal trajectories of the family of straight lines  $y=C x,$  where  $C$  is a parameter.
\end{exercise}
\begin{answer}
	\begin{align*}
	\text{we have,}\quad y&=C x\\
	\text{differentiating the given equation we get}\\
	dy&=cdx\\
	dy&=\frac{y}{x}dx\quad(\because c=\frac{y}{x})\\
	\frac{dy}{dx}=\frac{y}{x}\\
	{\frac{dy}{dx}}_{(ortho)}&=\frac{-x}{y}\\
	\text{ using variable separable method}\\
	(-xdx&=ydy)\\
	\int-xdx&=\int ydy\\
	-\frac{x^{2}}{2}&=\frac{y^{2}}{2}+C\\
		\frac{x^{2}}{2}+\frac{y^{2}}{2}&=C\\
		x^{2}+y^{2}&=2C\Longrightarrow \text{Represents the family of circles}
	\end{align*}
\end{answer}
\begin{exercise}
	Find the family of curves of the given trajectory,	$\frac{dy}{dx}=\frac{x}{y}$
\end{exercise}
\begin{answer}
\begin{align*}
\text{given},\frac{dy}{dx}&=\frac{x}{y}\\
\text{using variable seperable method, we get}\\
\int xdx&=\int ydy\\
\frac{x^{2}}{2}&=\frac{y^{2}}{2}+C\\
\frac{x^{2}}{2}-\frac{y^{2}}{2}&=C\\
x^{2}-y^{2}&=2C\Longrightarrow \text{family of hyperbolas}
\end{align*}
\end{answer}
\section{Second order differential equations}
\subsection{Linear differential equation}
If the degree of the dependent variable and all derivatives is one, such differential equations are called linear differential equations.
\begin{example}\hspace{0.5cm}
	\begin{enumerate}
		\item $2\frac{d^{2} y}{d x^{2}}+3\frac{d y}{d x}+4 y=x^{2}+x+1$
		\item $ \frac{d^{2} x}{d x^{2}}-\frac{d y}{d x}-3 y=x$
		\item $2 \frac{d^{2} x}{d t^{2}}-\frac{d x}{d t}-3 x=f(t)$
	\end{enumerate}
\end{example}
\subsection{Non-Linear differential equation}
If the degree of the dependent variable and / or its derivatives are of greater than 1 such differential equations are called non-linear differential equations.
\begin{example}\hspace{0.5cm}
	\begin{enumerate}
		\item $\frac{d^{2} y}{d x^{2}}+\frac{d y}{d x}+y^{2}=\sin x$
		\item  $\frac{d^{2} y}{d x^{2}}+2\left(\frac{d y}{d x}\right)^{2}+y^{2}=e^{x}$
		\item  $\left(\frac{d^{2} x}{d t^{2}}\right)^{2}+\frac{d x}{d t}+x=f(t)$
	\end{enumerate}
\end{example}
\subsection{Homogeneous differential equation}
A differential equation of the form
$y^{\prime \prime}+P(x) y^{\prime}+Q(x) y=F(x)$, is said to be  homogeneous if $F(x)= 0$
\begin{example}
	\hspace{0.5cm}
	\begin{enumerate}
		\item 	$\frac{d^{2} y}{d x^{2}}-6 \frac{d y}{d x}+13 y=0$
		\item $\frac{d^{2} y}{d x^{2}}+2\left(\frac{d y}{d x}\right)^{2}+y^{2}=0$
	\end{enumerate}

\end{example}
\subsection{Nonhomogeneous differential eqaution} A differential equation of the form
$y^{\prime \prime}+P(x) y^{\prime}+Q(x) y=F(x)$, is said to be  non-homogeneous if $F(x)\neq 0$
\begin{example}
\hspace{0.5cm}
\begin{enumerate}
	\item 	$\frac{d^{2} y}{d x^{2}}-6 \frac{d y}{d x}+ y=x^{2}+2$
	\item $\frac{d^{2} y}{d x^{2}}+2\left(\frac{d y}{d x}\right)^{2}+y^{2}=e^{x}$
\end{enumerate}
\end{example}
\section{Linear independance and dependance of solutions}
Two solutions of a differential equation, $ y_{1}(x)$ and $ y_{2}(x)$ are said to be linearly independant if \\$$Ay_{1}(x)+By_{2}(x)\neq 0 $$ given, $ A\neq0 \quad\text{and}\quad B\neq0$
\subsection{Wronskian}
A first-order homogeneous ODE has only one linearly independent solution. This is meant in the following sense. "If two solutions are linearly dependent, by definition they satisfy $a y_{1}(x)+b y_{2}(x)=0$ with nonzero constants $a, b$ for all values of $x$". If the only solution of this linear relation is $a=0=b$, then our solutions $y_{1}$ and $y_{2}$ are said to be linearly independent.
\\To prove this theorem, suppose $y_{1}, y_{2}$ both solve the homogeneous ODE. Then,
\begin{equation*}
\frac{y_{1}^{\prime}}{y_{1}}=-p(x)=\frac{y_{2}^{\prime}}{y_{2}} \quad \Rightarrow \quad W(x) \equiv y_{1}^{\prime} y_{2}-y_{1} y_{2}^{\prime} \equiv 0
\end{equation*}
The functional determinant $W$ is called the \textbf{Wronskian of the pair $y_{1}$, $y_{2}$}. We now show that $W \equiv 0$ is the condition for them to be linearly dependent. Assuming linear dependence, that is.
\begin{equation*}
a y_{1}(x)+b y_{2}(x)=0
\end{equation*}
In matrix form, the Wronskian of two functions $y_{1}(x)$ and $y_{2}(x)$ is given by,
\begin{equation}
W\left(y_{1}, y_{2}, x\right)=\left|\begin{array}{ll}
y_{1}(x) & y_{2}(x) \\
y_{1}^{\prime}(x) & y_{2}^{\prime}(x)
\end{array}\right|=y_{1}(x) y_{2}^{\prime}(x)-y_{1}^{\prime}(x) y_{2}(x)
\end{equation}
\begin{enumerate}
	\item If $W\left(y_{1}, y_{2}, x\right)=0,$ then $y_{1}(x)$ and $y_{2}(x)$ are linearly dependent.
	\item If $W\left(y_{1}, y_{2}, x\right) \neq 0,$ then $y_{1}(x), y_{2}(x)$ are linearly independent.
\end{enumerate}
\begin{note}
	The wronskian of a differential equation can also be written as,
	$$ W(t)=e^{-\int p(x)dx}$$
	\end{note}
\begin{exercise}
Consider two solutions $\mathrm{x}_{1}(\mathrm{t})$ and $\mathrm{x}_{2}(\mathrm{t})$ of the differential equation $\frac{d^{2} x(t)}{d t^{2}}+x(t)=0, t>0$, such that $x_{1}(0)=1,\left.\frac{d x_{1}(t)}{d t}\right|_{t=0}=0, x_{2}(0)=0,\left.\frac{d x_{2}(t)}{d t}\right|_{t=0}=1$. The Wronskian $W(t)=\left|\begin{array}{ll}x_{1}(t) & x_{2}(t) \\ \frac{d x_{1}(t)}{d t} & \frac{d x_{2}(t)}{d t}\end{array}\right|$ at $t=\frac{\pi}{2}$ is,
\end{exercise}
\begin{answer}
	The wronskian of a differential equation can also be written as,
	\begin{align*}
	W(t)&=e^{-\int p(x)dx}\\
	\text{But here,}\quad  p(x)&=0\\
	\text{Then,} \quad W(t)&=e^{0 \ dx}=1\\
	\text{So,}\quad W(\frac{\pi}{2})&=1
	\end{align*}
\end{answer}
\section{Linear Second Order Differential Equations With Constant Coefficients}
The general form of the linear differential equation of second order is
$$
\frac{d^{2} y}{d x^{2}}+P \frac{d y}{d x}+Q y=R
$$
Where $P$ and $Q$ are constants and $R$ is a function of $x$ or constant.\begin{note}\textbf{Differential operator:}\\
	A differential operator can be represented as,\quad $D=\frac{d}{dx}$
\\Then a differential equation can be written  in terms of differntial operators as,
\begin{align*}
D^{2} y+P D y+Q y&=R \\ \left(D^{2}+P D+Q\right) y&=R\\
\text{Where,}\quad D y&=\frac{d y}{d x}, \ \text{and}\ D^{2} y=\frac{d^{2} y}{d x^{2}}
\end{align*}

$\frac{1}{D}$ stands for the operation of integration.
\end{note}
\section{Solution of Second order homogeneous differential equation.}

\subsection{Method of solving}
\begin{enumerate}
	\item Let $y=C_{1} e^{m x}$ be the trial solution
	\begin{equation}
	\frac{d^{2} y}{d x^{2}}+P \frac{d y}{d x}+Q y=0\label{eq1}
	\end{equation}

	Putting the values of $y,\quad \frac{d y}{d x}$ and $\quad\frac{d^{2} y}{d x^{2}}$ in  \ref{eq1} then,\\ $C_{1} e^{m x}\left(m^{2}+P m+Q\right)=0$
	$\Rightarrow$
	$m^{2}+P m+Q=0 .$ It is called Auxiliary equation.
	\item Solve the auxiliary equation.
	\subsubsection{{Case 1:}}\textbf{ Roots are real and distinct}\\
	If $m_{1}$ and $m_{2}$ are the roots, then the C.F. is
	$$
	y=C_{1} e^{m_{1} x}+C_{2} e^{m_{2} x}
	$$
	\subsubsection{{Case 2:}}\textbf{ Roots are real and  equal}\\
	If both the roots are $m, m$ then the C.F. is
	$$
	y=\left(C_{1}+C_{2} x\right) e^{m x}
	$$
	\subsubsection{{Case 3:}}\textbf{ Roots are Imaginary}\\
	 If the roots are $\alpha \pm i \beta,$ then the solution will be
	$$
	\begin{aligned}
	y &=C_{1} e^{(\alpha+i \beta) x}+C_{2} e^{(\alpha-i \beta) x}=e^{\alpha x} \cdot\left[C_{1} e^{i \beta x}+C_{2} e^{-i \beta x}\right] \\
	&=e^{\alpha x}\left[C_{1}(\cos \beta x+i \sin \beta x)+C_{2}(\cos \beta x-i \sin \beta x)\right] \\
	&=e^{\alpha x}\left[\left(C_{1}+C_{2}\right) \cos \beta x+i\left(C_{1}-C_{2}\right) \sin \beta x\right]\\&=e^{\alpha x}[A \cos \beta x+B \sin \beta x]
	\end{aligned}
	$$
\end{enumerate}
\setlength\extrarowheight{10pt}
\begin{table}[H]
\begin{tabular}{|m{5cm}|m{4cm}|m{4cm}|}
\hline
Roots&Basis of solution&General solution\\\hline
Real and  equal(repeated root $m$)& $e^{m x}$ and $xe^{m x}$&$
y=\left(C_{1}+C_{2} x\right) e^{m x}
$\\\hline
Real and  distinct($m_{1}$ , $m_{2}$)& $e^{m_{1} x}$ ,$\quad e^{m_{2} x}$ &$
y=C_{1} e^{m_{1} x}+C_{2} e^{m_{2} x}
$\\\hline
Imaginary roots ($\alpha \pm i \beta$)&$ e^{(\alpha+i \beta) x}, e^{(\alpha-i \beta) x}$&$e^{\alpha x}[A \cos \beta x+B \sin \beta x]$\\\hline

\end{tabular}
\caption{Roots of homogeneous second order DE}
\end{table}
\begin{exercise}
	Solve $\frac{d^{2} y}{d x^{2}}-8 \frac{d y}{d x}+15 y=0$.
\end{exercise}
\begin{answer}
	\begin{align*}
	\text{Given equation can be written as,}\\
	\left(D^{2}-8 D+15\right) y&=0\\
	\text{Here auxiliary equation is,}\\ m^{2}-8 m+15&=0\\
	(m-3)(m-5)&=0 \quad \therefore m=3,5\\\text{Hence, the required solution is,}\\
	y&=C_{1} e^{3 x}+C_{2} e^{5 x}
	\end{align*}
\end{answer}
\begin{exercise}
	Solve the differential equation:
	$
	\frac{d^{2} y}{d x^{2}}+6 \frac{d y}{d x}+9 y=0
	$
\end{exercise}
\begin{answer}
We have
\begin{align*}
\frac{d^{2} y}{d x^{2}}+6 \frac{d y}{d x}+9 y&=0 \\
\Rightarrow \left(D^{2}+6 D+9\right) y&=0\\
\text{Auxiliary equation is}\quad D^{2}+6 D+9&=0\\
\Rightarrow \quad(D+3)^{2}&=0 \Rightarrow D=-3,-3\\
\text{the solution, y}&=\left(c_{1}+c_{2} x\right) e^{-3 x}
\end{align*}
\end{answer}
\begin{exercise}
	Solve $\left(D^{3}-1\right) y=0$
\end{exercise}
\begin{answer}
	\begin{align*}
	\text{we have,}\left(D^{3}-1\right) y&=0\\
	\text{The characteristic equation is,}\\
	m^{3}-1&=0 \Rightarrow m=1, \frac{-1 \pm \sqrt{3 i}}{2}\\\text { y }&=A e^{x}+e^{-x / 2} \cdot\left[B \cos \frac{\sqrt{3}}{2} x+C \sin \frac{\sqrt{3}}{2} x\right]
	\end{align*}
\end{answer}
\section{Solution of Second order nonhomogeneous differential equation.}
The solution of a differential equation of the form,$$\frac{d^{2} y}{d x^{2}}+P \frac{d y}{d x}+Q y=R$$ consists of two parts,a complementary function and a particular integral.
\\Complete Solution = Complementary Function + Particular Integral
\begin{center}
	\framebox{
		\parbox[t][0.75cm]{4cm}{

			\addvspace{0.2cm} \centering

			{y}\quad=\quad{C . F }\quad+\quad{P . I}} }
\end{center}
\subsubsection{Finding complementary function}
Complementary function is the solution obtained by solving the equation replacing R.H.S by 0.Same as that explained in finding solution to homogeneous differential equations.
\subsubsection{Finding Particular solution}
Particular integral (P.I) depends on the form of $R(x)$\\
If the differential equation is of the form,$$\left(D^{n}+k_{1} D^{n-1}+k_{2} D^{n-2}+\cdots+k_{n}\right) y=R(x)$$
\\Then the particular integral of the equation is given by,
$$
\text { P.I. }=\frac{1}{D^{n}+k_{1} D^{n-1}+k_{2} D^{n-2}+\cdots+k_{n}} R(x)
$$
The following cases arise for particular integrals:
\begin{enumerate}
	\item When $X=e^{a x},$ then
	$$
	\begin{aligned}
	\text { P.I. } &=\frac{1}{f(D)} e^{a x} \\
	&=\frac{1}{f(a)} e^{a x},\quad \text { If }\ f(a) \neq 0 \\
	\text { If } f(a)=0, \text { then } \\
	\text { P.I. } &=\frac{x}{f^{\prime}(a)} e^{a x}, \quad \text { If }\ f^{\prime}(a) \neq 0
	\end{aligned}
	$$
	If $f^{\prime}(a)=0,$ then
	$$
	\text { P.I. }=\frac{x^{2}}{f^{\prime \prime}(a)} e^{a x}, \quad \text { If }\ f^{\prime \prime}(a) \neq 0
	$$
	\item  When $X=\sin a x,$ then
	$$
	\begin{array}{c}
	\text { P.I. }=\frac{1}{f\left(D^{2}\right)} \sin a x \\
	=\frac{1}{f\left(-a^{2}\right)} \sin a x, \text { if } f\left(-a^{2}\right) \neq 0
	\end{array}
	$$
	\item When $X=\cos a x,$ then
	$$
	\begin{aligned}
	\text { P.I. } &=\frac{1}{f\left(D^{2}\right)} \cos a x \\
	&=\frac{1}{f\left(-a^{2}\right)} \cos a x, \text { if } f\left(-a^{2}\right) \neq 0
	\end{aligned}
	$$
	\item  When $X=x^{m}$, then
	$$
	\text { P.I. }=\frac{1}{f(D)} x^{m}=[f(D)]^{-1} x^{m}
	$$
	Expansion of $[f(D)]^{-1}$ is to be carried up to the term $D^{m}$ because $(m+1)^{\text {th }}$ and higher derivatives of $x^{m}$ are zero.
	\item When $X=e^{a x} v(x)$, then
	$$
	\begin{array}{l}
	\text { P.I. }=\frac{1}{f(D)} e^{a x} v(x) \\
	\text { P.I. }=e^{a x} \frac{1}{f(D+a)} v(x)
	\end{array}
	$$
	\item When $X=x v(x)$, then
	\begin{align*}
	\text { P.I. }&=\frac{1}{f(D)} x v(x)\\&=\left[x-\frac{f^{\prime}(D)}{f(D)}\right] \cdot \frac{1}{f(D)} v(x)
	\end{align*}
\end{enumerate}
\begin{exercise}
	Solve the differential equation:
	$$
	\frac{d^{2} y}{d x^{2}}+6 \frac{d y}{d x}+9 y=5 e^{3 x}
	$$
\end{exercise}
\begin{answer}
	We have
	\begin{align*}
	\frac{d^{2} y}{d x^{2}}+6 \frac{d y}{d x}+9 y&=5 e^{3 x} \\
	 \left(D^{2}+6 D+9\right) y&=5 e^{3 x}\\
	\text{Auxiliary equation is}\quad D^{2}+6 D+9&=0\\
(D+3)^{2}&=0 \Rightarrow D=-3,-3\\
	\text{The solution, y}&=\left(c_{1}+c_{2} x\right) e^{-3 x}\\
	\text { Particular integral } &=\frac{1}{D^{2}+6 D+9} \cdot 5 e^{3 x} \\
	&=\frac{5 e^{3 x}}{(3)^{2}+6(3)+9}=\frac{5 e^{3 x}}{36}\\
	\text{The complete solution is given by} y&=\mathrm{C} . \mathrm{F} .+\mathrm{P} . \mathrm{I}\\
 y&=\left(c_{1}+c_{2} x\right) e^{-3 x}+\frac{5 e^{3 x}}{36}
	\end{align*}
\end{answer}
\begin{exercise}
	Find the particular integral of the differential equation, $(D^{3}+8)=x^{4}-2x+1$
\end{exercise}
\begin{answer}
	We have,
	\begin{align*}
	(D^{3}+8)&=x^{4}-2x+1\\
	\text{P.I}&=\frac{1}{(D^{3}+8)}(x^{4}-2x+1)\\
	&=\frac{1}{8(1+\frac{D^{3}}{8})}(x^{4}-2x+1)\\
	&=\frac{[1+\frac{D^{3}}{8}]^{-1} }{8}(x^{4}-2x+1)
	\intertext{Using Binomial expansion on $[1+\frac{D^{3}}{8}]^{-1}$ we get,}
	[1+\frac{D^{3}}{8}]^{-1}&=[1-\frac{D^{3}}{8}+\cdots]
	\intertext{Higher terms in the expansion can be ommitted since , here the  highest power of $x$ is $4$ ($R(x)=x^{4}-2x+1$).}
	\text{Then,}\ \text{P.I}&=\frac{1}{8}[1-\frac{D^{3}}{8}](x^{4}-2x+1)\\
	&=\frac{1}{8}\left[ (x^{4}-2x+1)-\frac{D^{3} (x^{4}-2x+1)}{8}\right] \\
	&=\frac{1}{8}\left[ (x^{4}-2x+1)-\frac{24x}{8}\right] \\
	&=\frac{1}{8}\left[ (x^{4}-2x+1)-3x\right] \\
	&=\frac{1}{8}\left[ (x^{4}-x+1)\right]
	\end{align*}
\end{answer}

\section{Euler - Cauchy Differential equation}
Although second-order linear equations with constant coefficients are the ones used most frequently in applications, there are a few other kinds of second-order equations and methods of solving them which are also important. one of them is the Euler-Cauchy equation. An equation of the form,
 \begin{equation}
a_{n} x^{n} \frac{d^{n} y}{d x^{n}}+a_{(n-1)} x^{(n-1)} \frac{d^{(n-1)} y}{d x^{(n-1)}}+\cdots \cdots+a_{2} x^{2} \frac{d^{2} y}{d x^{2}}+a_{1} x \frac{d y}{d x}+a_{0} y=\mathrm{Q(x)}
\end{equation}
Where, $a_{0},a_{1},a_{2}\cdots a_{n} $ are constants is called an Euler or Cauchy equation. It can be reduced to a linear equation with constant coefficients by changing the independent variable from $x$ to $z$ where,
$$
x=e^{z} .
$$

$x \frac{d y}{d x}=\frac{d y}{d z}$
and $x^{2} \frac{d^{2} y}{d x^{2}}=\frac{d^{2} y}{d z^{2}}-\frac{d y}{d z}$.

 \begin{align*}
 \text{Put,} \ \mathrm{x}&=\mathrm{e}^{z} \Rightarrow \log \mathrm{x}=\mathrm{z} \Rightarrow \frac{1}{x}=\frac{d z}{d x}\\
 \frac{d y}{d x}&=\frac{d y}{d x} \cdot \frac{d z}{d x}\\&=\frac{1}{x} \frac{d y}{d z} \\ \mathrm{x} \frac{d y}{d x}&=\frac{d y}{d z}\\
 \frac{d^{2} y}{d x^{2}}&=\frac{d}{d x}\left(\frac{d y}{d x}\right)\\&=-\frac{1}{x^{2}} \frac{d y}{d z}+\frac{1}{x} \frac{d^{2} y}{d z^{2}}\left(\frac{d z}{d x}\right)\\&=-\frac{1}{x^{2}} \frac{d y}{d z}+\frac{1}{x^{2}} \frac{d^{2} y}{d z^{2}} \\ x^{2} \frac{d y}{d x^{2}}&=-\frac{d y}{d z}+\frac{d^{2} y}{d z^{2}}
\intertext{ Then neglecting the higher orders , the given equation becomes,}
  a_{2} \frac{d^{2} y}{d z^{2}}+\left(a_{1}-a_{2}\right) \frac{d y}{d z}+a_{0} y&=\mathrm{Q}
 \end{align*}
 \begin{exercise}
 	$x^{2} \frac{d^{2} y}{d x^{2}}+2 x \frac{d y}{d x}-20 y=(x+1)^{2}$
 \end{exercise}
\begin{answer}
	\begin{align*}
	x&=e^{z} \\ \log x&=z \Rightarrow \frac{1}{x}=\frac{d z}{d x}\\
	\text{Let,}\ x \frac{d y}{d x}&=\frac{d y}{d z}\\
	\text{and,} x^{2} \frac{d^{2} y}{d x^{2}}&=\frac{d^{2} y}{d z^{2}}-\frac{d y}{d z}\\
	\text{Then we get,} \frac{d^{2} y}{d z^{2}}+\frac{d y}{d z}-20 y&=\left(e^{z}+1\right)^{2}\\
	\text{C.F.} &=c_{1} e^{4 z}+c_{2} e^{-5 z}\\&=c_{1} x^{4}+c_{2} x^{-5}\\
	\text{P . I .}&=\frac{1}{D^{2}+D-20}\left(e^{z}+1\right)^{2}\\&=\frac{1}{D^{2}+D-20}\left(e^{2 z}+2 e^{z}+1\right)\\&=-\frac{1}{14} e^{2 z}-\frac{1}{9} e^{z}-\frac{1}{20}\\
	\text{Total solution} \ y&=c_{1} x^{4}+c_{2} x^{-5}-\frac{1}{14} x^{2}-\frac{1}{9} x-\frac{1}{20}
	\end{align*}
\end{answer}

%\section{Singular Points}
%The concept of singular point or singularity (as applied to a differential equation) stems from the ts usefulness in  classifying Ordinary Differential Equations  and  investigating the feasibility of a series solution (Series Solution method will be explained in the next section)
%If we write our second-order homogeneous differential equation (in $y$ ) as,
%\begin{equation}
%y^{\prime \prime}+P(x) y^{\prime}+Q(x) y=0 \label{DE001}
%\end{equation}
%We are ready to define ordinary and singular points. If the functions $P(x)$ and $Q(x)$ remain finite at $x=x_{0}$, point $x=x_{0}$ is an ordinary point. However, if either $P(x)$ or $Q(x)$ (or both) diverges as $x \rightarrow x_{0}$, point $x_{0}$ is a singular point. Using equation \ref{DE001} we may distinguish between two kinds of singular points.
%\begin{enumerate}
%	\item If either $P(x)$ or $Q(x)$ diverges as $x \rightarrow x_{0}$ but $\left(x-x_{0}\right) P(x)$ and $\left(x-x_{0}\right)^{2} Q(x)$ remain finite as $x \rightarrow x_{0}$, then $x=x_{0}$ is called a \textbf{regular}, or \textbf{nonessential, singular point.}
%	\item If $P(x)$ diverges faster than $\frac{1}{\left(x-x_{0}\right)} $ so that $\left(x-x_{0}\right) P(x)$ goes to infinity as $x \rightarrow x_{0}$, or $Q(x)$ diverges faster than $\frac{1}{\left(x-x_{0}\right)} ^{2}$ so that $\left(x-x_{0}\right)^{2} Q(x)$ goes to infinity as $x \rightarrow x_{0}$, then point $x=x_{0}$ is labeled an \textbf{irregular}, or \textbf{essential, singularity}.
%\end{enumerate}

\newpage
\begin{abox}
	Problem Set -1
\end{abox}
\begin{enumerate}[label=\color{ocre}\textbf{\arabic*.}]
	\item Let $x_{1}(t)$ and $x_{2}(t)$ be two linearly independent solutions of the differential equation $\frac{d^{2} x}{d t^{2}}+2 \frac{d x}{d t}+f(t) x=0$ and let $w(t)=x_{1}(t) \frac{d x_{2}(t)}{d t}-x_{2}(t) \frac{d x_{1}(t)}{d t} .$ If $w(0)=1$, then $w(1)$ is given by
	{\exyear{ NET/JRF(DEC-2011)}}
			\begin{tasks}(4)
			\task[\textbf{A.}] 1
			\task[\textbf{B.}] $e^{2}$
			\task[\textbf{C.}]  $1 / e$
			\task[\textbf{D.}] $1 / e^{2}$
		\end{tasks}
\item Let $y(x)$ be a continuous real function in the range 0 and $2 \pi$, satisfying the inhomogeneous differential equation: $\sin x \frac{d^{2} y}{d x^{2}}+\cos x \frac{d y}{d x}=\delta\left(x-\frac{\pi}{2}\right)$ The value of $d y l d x$ at the point $x=\pi / 2$
{\exyear{NET/JRF (JUNE-2012)}}
\begin{tasks}(2)
	\task[\textbf{A.}] Is continuous
	\task[\textbf{B.}] Has a discontinuity of 3
	\task[\textbf{C.}] Has a discontinuity of $1 / 3$
	\task[\textbf{D.}] Has a discontinuity of 1
\end{tasks}
\item The solution of the partial differential equation
$$
\frac{\partial^{2}}{\partial t^{2}} u(x, t)-\frac{\partial^{2}}{\partial x^{2}} u(x, t)=0
$$
satisfying the boundary conditions $u(0, t)=0=u(L, t)$ and initial conditions $u(x, 0)=\sin (\pi x / L)$ and $\left.\frac{\partial}{\partial t} u(x, t)\right|_{t=0}=\sin (2 \pi x / L)$ is
{\exyear{NET/JRF(JUNE-2013)}}
	\begin{tasks}(1)
		\task[\textbf{A.}] $\sin (\pi x / L) \cos (\pi t / L)+\frac{L}{2 \pi} \sin (2 \pi x / L) \cos (2 \pi t / L)$
		\task[\textbf{B.}] $2 \sin (\pi x / L) \cos (\pi t / L)-\sin (\pi x / L) \cos (2 \pi t / L)$
		\task[\textbf{C.}] $\sin (\pi x / L) \cos (2 \pi t / L)+\frac{L}{\pi} \sin (2 \pi x / L) \sin (\pi t / L)$
		\task[\textbf{D.}] $\sin (\pi x / L) \cos (\pi t / L)+\frac{L}{2 \pi} \sin (2 \pi x / L) \sin (2 \pi t / L)$
	\end{tasks}
	\item The solution of the differential equation
	$$
	\frac{d x}{d t}=x^{2}
	$$
	with the initial condition $x(0)=1$ will blow up as $t$ tends to
	{\exyear{NET/JRF(JUNE-2013)}}
	\begin{tasks}(4)
		\task[\textbf{A.}] 1
		\task[\textbf{B.}] 2
		\task[\textbf{C.}] $\frac{1}{2}$
		\task[\textbf{D.}] $\infty$
	\end{tasks}
	\item Consider the differential equation
	$$
	\frac{d^{2} x}{d t^{2}}+2 \frac{d x}{d t}+x=0
	$$
	with the initial conditions $x(0)=0$ and $\dot{x}(0)=1$. The solution $x(t)$ attains its maximum value when $t$ is
	{\exyear{NET/JRF(JUNE-2014)}}
	\begin{tasks}(4)
		\task[\textbf{A.}] $1 / 2$
		\task[\textbf{B.}] 1
		\task[\textbf{C.}] 2
		\task[\textbf{D.}] $\infty$
	\end{tasks}
	\item Consider the differential equation $\frac{d^{2} x}{d t^{2}}-3 \frac{d x}{d t}+2 x=0$. If $x=0$ at $t=0$ and $x=1$ at $t=1$, the value of $x$ at $t=2$ is
	{\exyear{NET/JRF(JUNE-2015)}}
	\begin{tasks}(4)
		\task[\textbf{A.}] $e^{2}+1$
		\task[\textbf{B.}] $e^{2}+e$
		\task[\textbf{C.}] $e+2$
		\task[\textbf{D.}] $2 e$
	\end{tasks}
	\item  If $y=\frac{1}{\tanh (x)}$, then $x$ is
	{\exyear{NET/JRF(DEC-2015)}}
	\begin{tasks}(4)
		\task[\textbf{A.}] $\ln \left(\frac{y+1}{y-1}\right)$
		\task[\textbf{B.}] $\ln \left(\frac{y-1}{y+1}\right)$
		\task[\textbf{C.}]  $\ln \sqrt{\frac{y-1}{y+1}}$
		\task[\textbf{D.}]  $\ln \sqrt{\frac{y+1}{y-1}}$
	\end{tasks}
	\item The solution of the differential equation $\frac{d x}{d t}=2 \sqrt{1-x^{2}}$, with initial condition $x=0$ at $t=0$ is
	{\exyear{NET/JRF(DEC-2015)}}
	\begin{tasks}(2)
		\task[\textbf{A.}] $x=\left\{\begin{array}{ll}\sin 2 t, & 0 \leq t<\frac{\pi}{4} \\ \sinh 2 t, & t \geq \frac{\pi}{4}\end{array}\right.$
		\task[\textbf{B.}] $x=\left\{\begin{array}{cc}\sin 2 t, & 0 \leq t<\frac{\pi}{2} \\ 1, & t \geq \frac{\pi}{2}\end{array}\right.$
		\task[\textbf{C.}] $x=\left\{\begin{array}{cc}\sin 2 t, & 0 \leq t<\frac{\pi}{4} \\ 1, & t \geq \frac{\pi}{4}\end{array}\right.$
		\task[\textbf{D.}] $x=1-\cos 2 t, \quad t \geq 0$
	\end{tasks}
	\item   The function $y(x)$ satisfies the differential equation $x \frac{d y}{d x}+2 y=\frac{\cos \pi x}{x}$. If $y(1)=1$, the value of $y(2)$ is
	{\exyear{NET/JRF(JUNE-2017)}}
	\begin{tasks}(4)
		\task[\textbf{A.}] $\pi$
		\task[\textbf{B.}] 1
		\task[\textbf{C.}] $1 / 2$
		\task[\textbf{D.}] $1 / 4$
	\end{tasks}
	\item   Consider the differential equation $\frac{d y}{d t}+a y=e^{-b t}$ with the initial condition $y(0)=0$. Then the Laplace transform $Y(s)$ of the solution $y(t)$ is
	{\exyear{NET/JRF(DEC-2017)}}
	\begin{tasks}(4)
		\task[\textbf{A.}] $\frac{1}{(s+a)(s+b)}$
		\task[\textbf{B.}] $\frac{1}{b(s+a)}$
		\task[\textbf{C.}] $\frac{1}{a(s+b)}$
		\task[\textbf{D.}] $\frac{e^{-a}-e^{-b}}{b-a}$
	\end{tasks}
	\item The number of linearly independent power series solutions, around $x=0$, of the second order linear differential equation $x \frac{d^{2} y}{d x^{2}}+\frac{d y}{d x}+x y=0$, is
	{\exyear{NET/JRF(DEC-2017)}}
	\begin{tasks}(1)
		\task[\textbf{A.}] 0 (this equation does not have a power series solution)
		\task[\textbf{B.}] 1
		\task[\textbf{C.}] 2
		\task[\textbf{D.}] 3
	\end{tasks}
	\item The differential equation $\frac{d y(x)}{d x}=\alpha x^{2}$, with the initial condition $y(0)=0$, is solved using Euler's method. If $y_{E}(x)$ is the exact solution and $y_{N}(x)$ the numerical solution obtained using $n$ steps of equal length, then the relative error $\left|\frac{\left(y_{N}(x)-y_{E}(x)\right)}{y_{E}(x)}\right|$ is proportional to
	{\exyear{NET/JRF(DEC-2017)}}
	\begin{tasks}(4)
		\task[\textbf{A.}] $\frac{1}{n^{2}}$
		\task[\textbf{B.}] $\frac{1}{n^{3}}$
		\task[\textbf{C.}] $\frac{1}{n^{4}}$
		\task[\textbf{D.}] $\frac{1}{n}$
	\end{tasks}
	\item  Consider the following ordinary differential equation
	$$
	\frac{d^{2} x}{d t^{2}}+\frac{1}{x}\left(\frac{d x}{d t}\right)^{2}-\frac{d x}{d t}=0
	$$
	with the boundary conditions $x(t=0)=0$ and $x(t=1)=1 .$ The value of $x(t)$ at $t=2$ is
	{\exyear{NET/JRF(JUNE-2018)}}
	\begin{tasks}(4)
		\task[\textbf{A.}] $\sqrt{e-1}$
		\task[\textbf{B.}] $\sqrt{e^{2}+1}$
		\task[\textbf{C.}]  $\sqrt{e+1}$
		\task[\textbf{D.}] $\sqrt{e^{2}-1}$
	\end{tasks}
	\item  In terms of arbitrary constants $A$ and $B$, the general solution to the differential equation $x^{2} \frac{d^{2} y}{d x^{2}}+5 x \frac{d y}{d x}+3 y=0$ is
	{\exyear{NET/JRF(DEC-2018)}}
	\begin{tasks}(4)
		\task[\textbf{A.}]  $y=\frac{A}{x}+B x^{3}$
		\task[\textbf{B.}] $y=A x+\frac{B}{x^{3}}$
		\task[\textbf{C.}] $y=A x+B x^{3}$
		\task[\textbf{D.}] $y=\frac{A}{x}+\frac{B}{x^{3}}$
	\end{tasks}
	\item The solution of the differential equation $x \frac{d y}{d x}+(1+x) y=e^{-x}$ with the boundary condition $y(x=1)=0$, is
	{\exyear{NET/JRF(JUNE-2019)}}
	\begin{tasks}(4)
		\task[\textbf{A.}] $\frac{(x-1)}{x} e^{-x}$
		\task[\textbf{B.}] $\frac{(x-1)}{x^{2}} e^{-x}$
		\task[\textbf{C.}] $\frac{(1-x)}{x^{2}} e^{-x}$
		\task[\textbf{D.}] $(x-1)^{2} e^{-x}$
	\end{tasks}
	\item The solution of the differential equation $\left(\frac{d y}{d x}\right)^{2}-\frac{d^{2} y}{d x^{2}}=e^{y}$, with the boundary conditions $y(0)=0$ and $y^{\prime}(0)=-1$, is
	{\exyear{NET/JRF(JUNE-2020)}}
	\begin{tasks}(4)
		\task[\textbf{A.}] $-\ln \left(\frac{x^{2}}{2}+x+1\right)$
		\task[\textbf{B.}] $-x \ln (e+x)$
		\task[\textbf{C.}] $-x e^{-x^{2}}$
		\task[\textbf{D.}]  $-x(x+1) e^{-x}$
	\end{tasks}
\end{enumerate}
 \colorlet{ocre1}{ocre!70!}
\colorlet{ocrel}{ocre!30!}
\setlength\arrayrulewidth{1pt}
\begin{table}[H]
	\centering
	\arrayrulecolor{ocre}
	\begin{tabular}{|p{1.5cm}|p{1.5cm}||p{1.5cm}|p{1.5cm}|}
		\hline
		\multicolumn{4}{|c|}{\textbf{Answer key}}\\\hline\hline
		\rowcolor{ocrel}Q.No.&Answer&Q.No.&Answer\\\hline
		1&\textbf{D} &2&\textbf{D}\\\hline
		3&\textbf{D} &4&\textbf{A} \\\hline
		5&\textbf{B} &6&\textbf{B} \\\hline
		7&\textbf{D}&8&\textbf{C}\\\hline
		9&\textbf{D}&10&\textbf{A}\\\hline
		11&\textbf{B} &12&\textbf{D}\\\hline
		13&\textbf{C}&14&\textbf{D}\\\hline
		15&\textbf{A}&16&\textbf{A} \\\hline

	\end{tabular}
\end{table}

\newpage
\begin{abox}
	Problem Set -2
\end{abox}
\begin{enumerate}[label=\color{ocre}\textbf{\arabic*.}]
	\item  The solution of the differential equation for $y(t): \frac{d^{2} y}{d t^{2}}-y=2 \cosh (t)$, subject to the initial conditions $y(0)=0$ and $\left.\frac{d y}{d t}\right|_{t=0}=0$, is
	{\exyear{GATE 2010}}
	\begin{tasks}(2)
		\task[\textbf{A.}] $\frac{1}{2} \cosh (t)+t \sinh (t)$
		\task[\textbf{B.}] $-\sinh (t)+t \cosh (t)$
		\task[\textbf{C.}] $t \cosh (t)$
		\task[\textbf{D.}] $t \sinh (t)$
	\end{tasks}
	\item The solutions to the differential equation $\frac{d y}{d x}=-\frac{x}{y+1}$ are a family of
	{\exyear{GATE 2011}}
	\begin{tasks}(1)
		\task[\textbf{A.}] Circles with different radii
		\task[\textbf{B.}] Circles with different centres
		\task[\textbf{C.}]  Straight lines with different slopes
		\task[\textbf{D.}]  Straight lines with different intercepts on the $y$-axis
	\end{tasks}
	\item The solution of the differential equation $\frac{d^{2} y}{d t^{2}}-y=0$, subject to the boundary conditions $y(0)=1$ and $y(\infty)=0$ is
	{\exyear{GATE 2014}}
	\begin{tasks}(4)
		\task[\textbf{A.}] $\cos t+\sin t$
		\task[\textbf{B.}] $\cosh t+\sinh t$
		\task[\textbf{C.}] $\cos t-\sin t$
		\task[\textbf{D.}]  $\cosh t-\sinh t$
	\end{tasks}
	\item  A function $y(z)$ satisfies the ordinary differential equation $y^{\prime \prime}+\frac{1}{z} y^{\prime}-\frac{m^{2}}{z^{2}} y=0$, where\\
	$m=0,1,2,3, \ldots . .$ Consider the four statements P, Q, R, S as given below.\\
	$\mathrm{P}: z^{m}$ and $z^{-m}$ are linearly independent solutions for all values of $m$\\
	Q: $z^{m}$ and $z^{-m}$ are linearly independent solutions for all values of $m>0$\\
	$\mathrm{R}$ : $\ln z$ and 1 are linearly independent solutions for $m=0$\\
	S: $z^{m}$ and $\ln z$ are linearly independent solutions for all values of $m$\\
	The correct option for the combination of valid statements is
	{\exyear{GATE 2015}}
	\begin{tasks}(4)
		\task[\textbf{A.}] P, R and S only
		\task[\textbf{B.}]  P and R only
		\task[\textbf{C.}] $\mathrm{Q}$ and $\mathrm{R}$ only
		\task[\textbf{D.}] $\mathrm{R}$ and $\mathrm{S}$ only
	\end{tasks}
	\item Consider the linear differential equation $\frac{d y}{d x}=x y$. If $y=2$ at $x=0$, then the value of $y$ at $x=2$ is given by
	{\exyear{GATE 2016}}
	\begin{tasks}(4)
		\task[\textbf{A.}]  $e^{-2}$
		\task[\textbf{B.}] $2 e^{-2}$
		\task[\textbf{C.}] $e^{2}$
		\task[\textbf{D.}]  $2 e^{2}$
	\end{tasks}
	\item Consider the differential equation $\frac{d y}{d x}+y \tan (x)=\cos (x)$. If $y(0)=0, y\left(\frac{\pi}{3}\right)$ is ............... (up to two decimal places)
	{\exyear{GATE 2017}}
	\item Given
	$$
	\frac{d^{2} f(x)}{d x^{2}}-2 \frac{d f(x)}{d x}+f(x)=0
	$$
	and boundary conditions $f(0)=1$ and $f(1)=0$, the value of $f(0.5)$ is --------(up
	to two decimal places).
	{\exyear{GATE 2018}}
	\item  For the differential equation $\frac{d^{2} y}{d x^{2}}-n(n+1) \frac{y}{x^{2}}=0$, where $n$ is a constant, the product of
	its two independent solutions is
	{\exyear{GATE 2019}}
	\begin{tasks}(4)
		\task[\textbf{A.}] $\frac{1}{x}$
		\task[\textbf{B.}] $x$
		\task[\textbf{C.}] $x^{n}$
		\task[\textbf{D.}] $\frac{1}{x^{n+1}}$
	\end{tasks}
	\end{enumerate}
\newpage
\begin{abox}
	Problem Set -3
\end{abox}
\begin{enumerate}[label=\color{ocre}\textbf{\arabic*.}]
	\item The order and degree of the differential equation $y+\frac{d y}{d x}=\frac{1}{4} \int y \cdot d x$ are

	\begin{tasks}(2)
		\task[\textbf{a.}]order $=2$ and degree $=1$
		\task[\textbf{b.}]order $=1$ and degree $=2$
		\task[\textbf{c.}]order $=1$ and degree $=1$
		\task[\textbf{d.}]order $=2$ and degree $=2$
	\end{tasks}
	\begin{answer}
		We have
		\begin{align*}
		y+\frac{d y}{d x}&=\frac{1}{4} \int y \cdot d x \\
		\Rightarrow \frac{d y}{d x}+\frac{d^{2} y}{d x^{2}}&=\frac{1}{4} y \quad \text { [on  differentiating w.r.t. $x$] }
		\end{align*}
		Differential equation is of order 2 and degree $1 .$\\\\
		Correct answer is \textbf{option(a)}
	\end{answer}
	\item The following differential equation has
	$$
	3\left(\frac{d^{2} y}{d t^{2}}\right)+4\left(\frac{d y}{d t}\right)^{3}+y^{2}+2=x
	$$
	\begin{tasks}(2)
		\task[\textbf{a.}]Degree $=2,$ order $=1$
		\task[\textbf{b.}]Degree $=1,$ order $=2$
		\task[\textbf{c.}]Degree $=4,$ order $=3$
		\task[\textbf{d.}]Degree $=2,$ order $=3$
	\end{tasks}
	\begin{answer}
		The highest derivative term of the equation is $2,$ hence order $=2$. The power of highest derivative term is 1 , hence degree $=1$
		\\\\	Correct answer is \textbf{option (b)}.
	\end{answer}
	\item  If $y(x)$ is the solution of the differential equation $-x \frac{d y}{d x}+y=y^{2} \log x$ with $y(1)=-1$
	then\begin{tasks}(1)
		\task[\textbf{a.}] $y(x)$ is defined and finite in the range $-\infty<x<0$
		\task[\textbf{b.}]$y(x)$ is defined and finite in the range $0<x<3$
		\task[\textbf{c.}] $y(x)$ is defined and finite in the range $x \geq 3$
		\task[\textbf{d.}]  $y(x)$ blows up at $x=e$
	\end{tasks}
	\begin{answer}
		\begin{align*}
		-x \frac{d y}{d x}+y&=y^{2} \log x \\\Rightarrow-\frac{d y}{d x}+\frac{y}{x}&=y^{2} \frac{\log x}{x}\\ \Rightarrow-\frac{1}{y^{2}} \frac{d y}{d x}+\frac{1}{x} \times \frac{1}{y}&=\frac{\log }{x}\\
		\text { Let } \frac{1}{y}&=z \Rightarrow-\frac{1}{y^{2}} \frac{d y}{d x}=\frac{d z}{d x}\\
		\text { Therefore, } \frac{d z}{d x}+\frac{z}{x}&=\frac{\log x}{x} \Rightarrow \frac{d z}{d x}+\frac{1}{x} z=\frac{\log x}{x}\\
		\text { Here, } \text { I.F. }&=e^{\int \frac{1}{x} d x}=e^{\log x}=x\\
		\text { Therefore, required solution will be }\\\qquad z x=\int \frac{\log x}{x} \times x d x+c \Rightarrow \frac{x}{y}&=\int \log x+c \Rightarrow \frac{x}{y}=(x \log x-x)+c \\
		\text { Now, } y(1)=-1, \text { put } x=1, y=-1 \quad &\Rightarrow-1=0-1+c \Rightarrow c=0 \\
		\text { Therefore, } \frac{x}{y}&=x \log x-x \Rightarrow y=\frac{1}{\log x-1}
		\end{align*}
		Therefore, for $y$ to be defined $\log x$ must be defined i.e., $x>0$\\
		\\ The solution will not be defined when $(\log x-1)=0\Rightarrow \log x=1 \Rightarrow x=e \simeq 2.73$
		\\\\So in the range $0<x<3$ [option (b)], there will be a point $x=2.73$ at which $y$ is not defined.\\\\ Then  Correct answers are \textbf{option (c)} and \textbf{option (d)}.
	\end{answer}
	\item The initial velocity of an object is $40 \mathrm{~m} / \mathrm{s}$. The acceleration $a$ of the object is given by the following expression:
	$$
	a=-0.1 v
	$$
	where $v$ is the instantaneous velocity of the object. The velocity of the object after $3 \mathrm{~s}$ will be
	\begin{answer}
		We are given the following expression:

		\begin{align*}{c}
		a&=-0.1 v \\
		\frac{d v}{d t}&=-0.1 v \\
		\frac{d v}{v}&=-0.1 d t
		\intertext{On integration we get,}
		\ln v&=-0.1 t+\ln k \\
		v&=k e^{-0.1 t}\\
		\text{	at $t=0 ; v=40$}
		\Rightarrow k&=40\\
		v&=40 e^{-0.1 t}\\
		\text{	At $t=3 \mathrm{~s}$},
		V&=40 e^{-0.1 \times 3}=29.6327 \mathrm{~m} / \mathrm{s}
		\end{align*}

	\end{answer}
	\item Solve $y d x-x d y+\left(1+x^{2}\right) d x+x^{2} \sin y d y=0$
	\begin{answer}
		\begin{align*}
		\text{	Dividing each term of the given equation by \quad}x^{2}, \text{we get}\\
		\frac{y d x-x d y}{x^{2}}+\frac{1+x^{2}}{x^{2}} d x+\sin y d y&=0\\ \Rightarrow-\frac{x d y-y d x}{x^{2}}+\left(\frac{1}{x^{2}}+1\right) d x+\sin y d y&=0\\
		\Rightarrow-d\left(\frac{y}{x}\right)+\left(1+\frac{1}{x^{2}}\right) d x+\sin y d y&=0\\
		\text{Integrating,}\\ -\left(\frac{y}{x}\right)+x-\frac{1}{x}&=\cos y+c \\\Rightarrow-y+x^{2}-1-x \cos y&=c x
		\end{align*}
	\end{answer}
	\item One of the possible solutions of the differential equation
	$y \sqrt{\left(1+x^{2}\right)} d y+x \sqrt{\left(1+y^{2}\right)} d x=0$ (where $c$ is some constant) is
	\begin{tasks}(2)
		\task[\textbf{a.}]$\left(\sqrt{1+y^{2}}\right)\left(\sqrt{1+x^{2}}\right)=c$
		\task[\textbf{b.}]$\frac{\sqrt{1+y^{2}}}{\sqrt{1+x^{2}}}=c$
		\task[\textbf{c.}]$\sqrt{1+y^{2}}+\sqrt{1+x^{2}}=c$
		\task[\textbf{d.}]$\sqrt{1+y^{2}}-\sqrt{1+x^{2}}=c$
	\end{tasks}
	\begin{answer}
		\begin{align*}
		y \sqrt{\left(1+x^{2}\right)} d y+x \sqrt{\left(1+y^{2}\right)} d x&=0\\ \frac{y}{\sqrt{1+y^{2}}} d y+ \frac{x}{\sqrt{1+x^{2}}} d x&=0 \\
		\int \frac{y}{\sqrt{1+y^{2}}} d y+\int \frac{x}{\sqrt{1+x^{2}}} d x&=c
		\intertext{ Let,\ $1+y^{2}=t$ and  $1+x^{2}=z$ }
		\int \frac{1}{2} t^{-1/2} d t+\int \frac{1}{2} z^{-1/2} d z&=c \\
		\sqrt{t}+ \sqrt{z}&=c \\
		\sqrt{1+y^{2}}+\sqrt{1+x^{2}}&=c
		\end{align*}
		Correct answer is \textbf{option (c)}.
	\end{answer}
	\item The solution of the differential equation
	$\left(e^{y}+2\right) \sin x d x-e^{y} \cos x d y=0$ (where $c$ is some constant) is
	\begin{tasks}(2)
		\task[\textbf{a.}] $\left(e^{y}+2\right) \sin x=c$
		\task[\textbf{b.}]$\left(e^{y}+2\right) \cos x=c$
		\task[\textbf{c.}] $\left(e^{y}+2\right) \operatorname{cosec} x=c$
		\task[\textbf{d.}] $\left(e^{y}+2\right) \sec x=c$
	\end{tasks}
	\begin{answer}
		\begin{align*}
		M&=\left(e^{y}+2\right) \sin x \quad  N=-e^{y} \cos x \\ \frac{\partial M}{\partial y}&=e^{y} \sin x \quad  \frac{\partial N}{\partial x}=e^{y} \sin x \\
		\Rightarrow \frac{\partial M}{\partial y}&=\frac{\partial N}{\partial x} \\ \int\left(e^{y}+2\right) \sin x d x+0&=c \\\left(e^{y}+2\right) \cos x&=-c=c\\
		\left(e^{y}+2\right) \cos x&=c
		\end{align*}
		Correct answer is \textbf{option (b)}.
	\end{answer}
	\item Solve $x(y-x) \frac{dy}{dx}= y(y+x)$

	\begin{answer}
		\begin{align*}
		\text {  Let, }\ \mathrm{y}&=\mathrm{v} \mathrm{x} ; \quad  \frac{d y}{d x}=\mathrm{v}+\mathrm{x} \frac{d v}{d x}\\
		\mathrm{v}+\mathrm{x} \frac{d v}{d x}&=\frac{v^{2}x^{2}+v x^{2}}{v x^{2}-x^{2}}=\frac{v^{2}+v }{v -1}\\
		\mathrm{x} \frac{d v}{d x}&=\frac{2v}{v-1}\\
		\frac{v-1}{2v}{d v}&=\frac{1}{x}{d x}\\
		\int \frac{1}{2} dv-\int \frac{1}{2v} dv&=\int \frac{1}{x} dx\\
		\int \frac{1}{2} dv- \frac{1}{2}\int\frac{1}{v} dv&=\int \frac{1}{x} dx\\
		\frac{1}{2}v- \frac{1}{2}\log{v} &=\log{x}+C\\
		v- \log{v} &=2\log{x}+C\\
		v&=\frac{y}{x}\\
		\text{Then,}\ \frac{y}{x}-\log{{\frac{y}{x}}x^{2}}&=C\\
		\frac{y}{x}-\log{xy}&=C\\
		\end{align*}
	\end{answer}
	\item  Determine the order and degree of
	$$
	\frac{\left[1+(d y / d x)^{2}\right]^{3 / 2}}{d^{2} y / d x^{2}}=K
	$$
	\begin{tasks}(2)
		\task[\textbf{a.}] Order =1 and Degree = 2
		\task[\textbf{b.}] Order =2 and Degree = 2
		\task[\textbf{c.}] Order =2 and Degree = 1
		\task[\textbf{d.}]Order =2 and Degree = 3
	\end{tasks}
	\begin{answer}
		The given differential equation when written as a polynomial in derivatives becomes
		$$
		K^{2}\left(\frac{d^{2} y}{d x^{2}}\right)^{2}=\left[1+\left(\frac{d y}{d x}\right)^{2}\right]^{3}
		$$
		The highest order differential coefficient in this
		equation is $\frac{d^{2} y}{d x^{2}}$ and its power is 2 .
		\\The order is 2 and degree is 2 .\\\\The correct answer is option \textbf{b} .
	\end{answer}
	\item Consider a linear ordinary differential equation:
	$\frac{d y}{d x}+p(x) y=r(x)$. Functions $p(x)$ and $r(x)$ are defined and have a continuous first derivative. The integrating factor of this equation is non-zero. Multiplying this equation by its integrating factor converts this into a:

	\begin{tasks}(1)
		\task[\textbf{a.}] Homogeneous differential equation
		\task[\textbf{b.}]Non-linear differential equation
		\task[\textbf{c.}]Second-order differential equation
		\task[\textbf{d.}]Exact differential equation
	\end{tasks}
	\begin{answer}
		Linear differential equation
		$$
		y^{\prime}+p(x) y=r(x)
		$$
		Multiplying above equation by integrating factor $e^{\int p(x) d x}$ makes the equation exact.\\The correct answer is option \textbf{d} .
	\end{answer}
	\item 	 The particular integral of the differential equation $\left(D^{2}+D+1\right) y=\cos 2 x$ is $\frac{1}{\alpha}(2 \sin 2 x-3 \cos 2 x) .$ Then the value of $\alpha$ is.....

\begin{answer}
	\begin{align*}
	P.I. &=\frac{1}{D^{2}+D+1} \cdot \cos 2 x\\&=\frac{1}{-2^{2}+D+1} \cdot \cos 2 x\\&=\frac{1}{D-3} \cdot \cos 2 x\\
	\Rightarrow P . I .&=\frac{D+3}{D^{2}-9} \cdot \cos 2 x\\&=\frac{D+3}{-2^{2}-9} \cdot \cos 2 x\\&=\frac{1}{13}(2 \sin 2 x-3 \cos 2 x)
	\end{align*}
	So the correct answer is 13
\end{answer}
\item The particular integral of the differential equation $\frac{d^{2} y}{d x^{2}}+2 \frac{d y}{d x}+2 y=\sin x$ is $\frac{1}{5}(\sin x-\alpha \cos x) .$ Then the value of $\alpha$ is........
\begin{answer}
	\begin{align*}
	P \cdot I .&=\frac{1}{D^{2}+2 D+2} \sin x\\&=\frac{1}{-1+2 D+2} \sin x\\&=\frac{2 D-1}{4 D^{2}-1} \sin x\\&=-\frac{1}{5}(2 D-1) \sin x\\
	\Rightarrow P \cdot I .&=-\frac{1}{5}(2 \cos x-\sin x)\\&=\frac{1}{5}(\sin x-2 \cos x)
	\end{align*}
	So the correct answer is 2
\end{answer}
	\item The particular integral of the differential equation $\left(D^{2}+5 D+4\right) y=3-2 x$ is $\frac{1}{8}[\alpha-4 x]$.
\begin{answer}
	\begin{align*}
	P.I. &=\left[D^{2}+5 D+4\right]^{-1}(3-2 x)\\&=\frac{1}{4}\left[1+\frac{5}{4} D+\frac{5}{4} D^{2}\right]^{-1}(3-2 x)\\
	\Rightarrow P.I. &=\frac{1}{4}\left[1-\frac{5}{4} D-\frac{5}{4} D^{2}\right](3-2 x)\\&=\frac{1}{4}\left[3-2 x-\frac{5}{4} \times-2\right]\\&=\frac{1}{8}[11-4 x]
	\end{align*}
	So the correct answer is 11
\end{answer}
\item  Find the Wronskian $W(t)$ of the given differential equation without solving the equation. $\left(1-x^{2}\right) y ^{\prime \prime}-2 x y^{\prime} +\alpha(\alpha+1) y=0$.
\begin{answer}
	\begin{align*}
	\intertext{ Writing the equation in standard form, we find that,}
	p(x)&=-2 x /\left(1-x^{2}\right)\\
	 \text{The Wronskian is }\ W(t)&=c \cdot \exp \left(-\int \frac{-2 x}{1-x^{2}} d x\right)\\&=c \cdot \exp \left(-\ln \left|1-x^{2}\right|\right)\\&=c\left|1-x^{2}\right|^{-1}
	 \intertext{where $c$ is some constant.}
	\end{align*}
\end{answer}
\item Find whether the functions $1, x, \sin x$ are linearly independent.
\begin{answer}
	 We write and evaluate the Wronskian,
	 $$
	 W=\left|\begin{array}{rrr}
	 1 & x & \sin x \\
	 0 & 1 & \cos x \\
	 0 & 0 & -\sin x
	 \end{array}\right|=-\sin x
	 $$
	 Since $-\sin x$ is not identically equal to zero, the functions are linearly independent.

\end{answer}

\end{enumerate}

CSIR- Mathematical Physics/chapter/Differential equations.tex


\documentclass[a4paper,12pt]{article}

\usepackage{ucs}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage[pdftex]{graphicx}
\usepackage[margin=2.5cm]{geometry}

\usepackage[pdftex]{hyperref}
\usepackage{url}

\title{Frequentist coverage study: intervals for a binomial parameter}
\author{}
\date{}

\begin{document}
 \maketitle

 We are studying the case of a binomial law:

 $$P(n) = B(n;N,p) = \left( ^N_n \right) p^n (1-p)^{N-n}$$

 This corresponds to repeating an experiment $N$ times, and counting $n$ the number of times of ``sucess'', where the probability for this success is $p$. $n$ is a random variable and follows this binomial law, of parameters $N$ and $p$. One real-life example is the estimation of an efficiency: for instance, $n$ could be the number of counts in a particle detector,
 or passing some selection, while $N$ is the total number of particles or events considered.

 Interval estimation of the binomial parameter $p$ is a common problem, however nontrivial because the problem is discrete. There is abundant bibliography on the subject, and we will review
 some of the most popular methods available, as well as their frequentist coverage.

 \section{Prelude}

 \begin{enumerate}
  \item Show that the mean is $E(n) = pN$ and the variance $V(n) = N p (1-p)$.
  \item What is the maximum likelihood estimate $\hat{p}$? What is its variance?
  \item Propose a simple algorithm for generating $n$ following a binomial law $B(n;N,p)$, assuming a uniform generator between 0 and 1.
  \item Draw the binomial distribution for $N=10$, $p=0.9$.
 \end{enumerate}

 \section{Interval estimation}

 For convenience, we will use the notation

 $$Z_{\alpha/2} = \Phi^{-1}(1-\alpha/2) = -\Phi^{-1}(\alpha / 2)$$

 where

 $$\Phi(Z) = \frac{1}{\sqrt{2\pi}} \int_{-\infty}^Z \exp(-t^2 / 2) \text{d} t = \frac{1+\text{erf}(Z/\sqrt{2})}{2},$$

 so that

 $$Z = \sqrt{2}\, \text{erf}^{-1} (1-\alpha).$$

 Example: $Z_{\alpha/2} = 1$ for $1-\alpha = 0.6827$.

 \begin{enumerate}
  \item \textbf{Wald interval} This procedure (that we will see should be avoided) simply substitutes $\hat{p}$ for $p$ in the variance of $n$, in a Gaussian approximation. Give explicitly
  the Wald interval for any C.L.
  \item \textbf{Wilson score interval} The Wald intervals neglect the fact that $V(\hat{p})$ depends on p. E.B. Wilson proposed in 1927 to quote the largest interval $[p_1,p_2]$ such that $p_1 + Z_{\alpha/2} \sigma(p_1) < \hat{p} < p_2-Z_{\alpha/2}\sigma(p_2)$. Give the expression for such interval.
  \item \textbf{Agresti and Coull} These authors proposed to use the midpoint $\tilde{p}$ of the Wilson interval in the formula for the Wald interval, instead of the MLE $\hat{p}$. Give the corresponding interval.
  \item \textbf{Clopper-Pearson} These intervals use the Neyman construction and ensure strict frequentist coverage. The ordering rule is as follows: the lower and upper limits are constructed separately, with C.L. $(1-\alpha)/2$.
%   \begin{enumerate}
    Write a function that builds the confidence belt in the $(n,p)$ plane. You may first build the lower limits, then the upper limits, and combine the two together.
   Draw it for $N=10$ and with a step size in $p$ of 0.01.
%    \item The duality with hypothesis test inversion may also be used: use this method to give the C-P interval in $p$ for given $n$ and $N$.
%    It can be done analytically using the following identity:
%    $$\sum_{i=n}^{N} \left(^N_i\right) p^i (1-p)^{N-i} = I_p (n,N-n+1)$$
%    where $I_p (\alpha,\beta)$ is the regularised incomplete Beta function:
%    $$I_p (\alpha,\beta) = \frac{\text{B}(p;\alpha,\beta)}{\text{B}(\alpha,\beta)},$$
%    defined from the incomplete Beta function,
%    $$\text{B} (p;\alpha,\beta)=\int _{0}^{p}t^{\alpha-1}\,(1-t)^{\beta-1}\text{d}t.$$
%    The incomplete Beta function is available in \texttt{scipy} as \texttt{scipy.special.betainc}.
%   \end{enumerate}
%   \item \textbf{Feldman-Cousins} The Neyman construction is used again, this time with the likelihood ratio ordering. Write this likelihood ratio and repeat confidence belt construction
%   as above.
% %   \item \textbf{Lancaster mid-P} This methods aims at solving the large overcoverage of the Clopper-Pearson intervals. In the Neyman construction, this time half of the probability of the observed $n_\text{obs}$ is added to the tail of the probability.
%   \item \textbf{Bayesian with uniform prior} Give the posterior Bayesian probability for $p$ assuming a uniform prior, and use it to define the corresponding central interval (with equal posterior probability on both sides). It will be useful to use the Beta distribution:
%   $$\text{Beta}(p;\alpha,\beta) = \frac{1}{B(\alpha,\beta)} p^{\alpha-1} (1-p)^{\beta-1}.$$
%   \item \textbf{Bayesian with Jeffreys' prior} Show that Jeffreys' prior for $p$ is proportional to $1/\sqrt{p(1-p)}$. Give the Bayesian posterior probability and the corresponding central interval with this prior.
 \end{enumerate}

 \subsection{Comparison of the intervals in particular cases}

 Compare the intervals on $p$ from the above methods, in the following cases:

 \begin{itemize}
 \item $N=10$, $n=10$
  \item $N=10$, $n=9$
  \item $N=10$, $n=5$
  \item $N=100$, $n=90$
 \end{itemize}

 \section{Study of frequentist coverage properties of various types of intervals}

 For each of the intervals above, study the frequentist properties of the interval estimation for $p$. In practice this is done in the following way:
 \begin{itemize}
  \item Fix the true value of the parameters $p$ and $N$;
  \item Generate $n$ according to $B(n;N,p)$;
  \item Compute the interval knowing $n$ and $N$;
  \item Check if the true value of $p$ is in this interval;
  \item Repat $N_\text{trials}$ times (e.g. 1000 times);
  \item Report the fraction of times that the true value of $p$ was inside the interval, and compare to the target confidence level (C.L.).
 \end{itemize}

 We will study 68.27\% C.L. intervals, in 3 ways:

 \begin{enumerate}
  \item set $N=10$ and check coverage as a function of $p$ for $0 \leq p \leq 1$
  \item make a 2-dimensional plot of coverage as a function of $p$ and $N$, for $0 \leq p \leq 1$ and $2 \leq N \leq 20$
  \item average the previous plot over all values of $p$, to get the average coverage as a function of $N$.
 \end{enumerate}

 \begin{thebibliography}{9}
  \bibitem{Cousins:2009kz}
  R.~D.~Cousins, K.~E.~Hymes and J.~Tucker,
  %``Frequentist evaluation of intervals estimated for a binomial parameter and for the ratio of Poisson means,''
  Nucl.\ Instrum.\ Meth.\ A {\bf 612} (2010) 388
  doi:10.1016/j.nima.2009.10.156
  [arXiv:0905.3831 [physics.data-an]].
  %%CITATION = doi:10.1016/j.nima.2009.10.156;%%
  %19 citations counted in INSPIRE as of 14 Nov 2018
  \bibitem{root} \texttt{TEfficiency} class documentation, \url{https://root.cern.ch/doc/master/classTEfficiency.html}.
 \end{thebibliography}

\end{document}


\section{Simplifying the expression \texorpdfstring{$1-w_p(\phi)^2$ from $y_p(\phi)$}{}}

\textit{Objective:} obtain the simplest expression for $1-w_p(\phi)^2$ in terms of $\phi,\beta$.

The original expression for $1-w_p(\phi)^2$ is below, with the denominator removed for simplicity.

{\footnotesize\begin{align}
    (3\pi+8)^2\beta^4\sin^2(2k)(1-w_p(\phi)^2)&=\underbrace{{(3\pi+8)^2\beta^4\sin^2(2k)-\left[(3\pi+8)^2\beta^4-8(3\phi+2)(3\pi+8)\beta^2+16(3\phi+2)^2\right]}}_{\gamma_1(\phi)}\\
    &-\underbrace{{2\sin(2k)(4\sin^2(k)+6)((3\pi+8)\beta^2-4(3\phi+2))}}_{\gamma_2(\phi)}\\
    &-\underbrace{{\sin^2(2k)(16\sin^4(k)+48\sin^2(k)+36)}}_{\gamma_3(\phi)}\\
    &=\gamma_1(\phi)-\gamma_2(\phi)-\gamma_3(\phi)
\end{align}}

Applying Equations 1-3 to the denoted sub-functions $\gamma_1(\phi),\gamma_2(\phi),\gamma_3(\phi)$, we get

\begin{align}
    \gamma_1(\phi)&=(3 \pi+8)^{2} \beta^{4}\left(\cos ^{2}(2 \phi)-1\right)+8(3 \phi+2)\left((3 \pi+8) \beta^{2}-2(3 \phi+2)\right)\\
    \gamma_2(\phi)&=-2(8 \cos (2 \phi)+2\sin(2\phi)\cos(2\phi))\left((3 \pi+8) \beta^{2}-4(3 \phi+2)\right)\\
    &=-4\cos(2\phi)(\sin(2\phi)+2)\left((3\pi+8)\beta^2-4(3\phi+2)\right)\\
    \gamma_3(\phi)&=-\cos ^{2}(2 \phi)\left(16 \sin \left(\phi+\frac{\pi}{4}\right)^{4}+48 \sin ^{2}\left(\phi+\frac{\pi}{4}\right)+36\right)\\
    &=-\cos^2(2\phi)\left(4\sin^2(2\phi)+6\right)^2
\end{align}

Putting this together, a simplified expression is

\begin{align}
    1-w_p(\phi)^2&=\frac{\gamma_1}{(3\pi+8)^2\beta^4\cos^2(2\phi)}+\frac{\gamma_2}{(3\pi+8)^2\beta^4\cos^2(2\phi)}+\frac{\gamma_3}{(3\pi+8)^2\beta^4\cos^2(2\phi)}\\
    &=\underbrace{\frac{\cos^2(2\phi)-1}{\cos^2(2\phi)}}_{\frac{-(1-\cos^2(2\phi))}{\cos^2(2\phi)}=\frac{-\sin^2(2\phi)}{\cos^2(2\phi)}=\boxed{-\tan^2(2\phi)}}+\frac{8(3\phi+2)((3\pi+8)\beta^2-2(3\phi+2))}{(3\pi+8)^2\beta^4\cos^2(2\phi)}\\
    &-\frac{4(\sin(2\phi)+2)((3\pi+8)\beta^2-4(3\phi+2))}{(3\pi+8)^2\beta^4\cos(2\phi)}-\frac{\left(4\sin^2(2\phi)+6\right)^2}{(3\pi+8)^2\beta^4}
\end{align}

Because $y_p(\phi)=\sqrt{1-w_p(\phi)^2}\sqrt{\frac{\mu}{r_0}}\cot(\phi+\pi/4)$, by substitution

{\tiny\begin{equation}
    \boxed{y_p(\phi)=\sqrt{-\tan^2(2\phi)+\frac{8(3\phi+2)((3\pi+8)\beta^2-2(3\phi+2))}{(3\pi+8)^2\beta^4\cos^2(2\phi)}-\frac{4(\sin(2\phi)+2)((3\pi+8)\beta^2-4(3\phi+2))}{(3\pi+8)^2\beta^4\cos(2\phi)}-\frac{\left(4\sin^2(2\phi)+6\right)^2}{(3\pi+8)^2\beta^4}}\sqrt{\frac{\mu}{r_0}}\cot(\phi+\pi/4)}
\end{equation}}


\section{Computing the Time-Step Using Higher-Order DG Schemes}

When making the jump to higher-order DG schemes, we can simply do the same as in the first-order scheme, except we compute the quantities in all of the nodal points instead of using a cell-average. This is valid because the cell-average is a convex combination...\sd{Need to expand on this}. The proof starts with the discretized equation valid at each quadrature point, $q$:
\begin{equation}
    \bU_{q}^{n+1}=\bU_{q}^{n}+\Delta t\,\cL_{q}^{n},
\end{equation}
where $\cL_{q}^{n}$ is a general form of the RHS at time $t^{n}$. If we define a vector $\ol{\bU}\equiv\left(\bU_{1},\cdots,\bU_{q},\cdots,\bU_{Q}\right)^T$, where $Q$ is the total number of quadrature points, and $\ol{\bW}\equiv\left(\bW_{1},\cdots,\bW_{q},\cdots,\bW_{Q}\right)^T$ as a vector of quadrature weights, then we can write the cell-average of $\bU$ as:
\begin{equation}
    \bU_{K}\equiv\ol{\bW}^T\ol{\bU}.
\end{equation}
If we then compute the cell-average of the above equation, we get:
\begin{equation}
    \bU_{K}^{n+1}=\bU_{K}^{n}+\Delta t\,\ol{\bW}^{T}\,\ol{\cL}_{q}^{n}=\ol{\bW}^{T}\left(\ol{\bU}^{n}+\Delta t\,\ol{\cL}^{n}\right)
\end{equation}

\subsection{High-Order Time-Step Restriction for DG}

\blue{NOTE:} This closely follows Jesse's document CFLCondition.pdf.

Consider the one-dimensional system of hyperbolic balance equations:
\begin{equation}\label{Eq:HypBalEqns}
    \pd{\left(\sqrtgm\,\bU\right)}{t}+\pd{\left(\sqrtgm\,\bF^{1}\left(\bU\right)\right)}{1}=\sqrtgm\,\bQ,
\end{equation}
where $\bU$ is a vector of conserved variables, $\bF^{1}\left(\bU\right)$ are the fluxes of those conserved variables in the $x^{1}$-direction, $\bQ$ is a source term, and $\sqrtgm$ is the square-root of the determinant of the spatial three-metric.

We define our reference element by:
\begin{equation}
    I_{j}\equiv\left\{x^{1}:x^{1}\in\left(x^{1}_{L},x^{1}_{H}\right)=\left(x^{1}_{\jmh},x^{1}_{\jph}\right)\right\}.
\end{equation}

We proceed by multiplying \eqref{Eq:HypBalEqns} with $v$, where $v=v\left(x^{1}\right)$ is a test function in the DG scheme, and integrate over the $\jth$ element:
\begin{equation}
    \int_{I_{j}}\pd{\left(\sqrtgm\,\bU\right)}{t}\,v\,dx^{1}+\int_{I_{j}}\pd{\left(\sqrtgm\,\bF^{1}\left(\bU\right)\right)}{1}\,v\,dx^{1}=\int_{I_{j}}\sqrtgm\,\bQ\,v\,dx^{1}.
\end{equation}
We now move the flux term to the RHS and perform integration-by-parts on it, yielding:
\begin{equation}\label{Eq:IntByParts}
    \int_{I_{j}}\pd{\left(\sqrtgm\,\bU\right)}{t}\,v\,dx^{1}=-\left[\sqrtgm\,\hat{\bF^{1}}\,v\Big|_{x^{1}_{H}}-\sqrtgm\,\hat{\bF^{1}}\,v\Big|_{x^{1}_{L}}\right]+\int_{I_{j}}\sqrtgm\,\bF^{1}\,\pd{v}{1}\,dx^{1}+\int_{I_{j}}\sqrtgm\,\bQ\,v\,dx^{1},
\end{equation}
where $\hat{\bF^{1}}$ is a numerical flux.

\blue{NOTE:} $v=1$ is in the space of test functions for the DG method, \textit{and} $v=1$ yields the cell-average when substituted into \eqref{Eq:IntByParts}, therefore the DG method evolves the cell-average.

Substituting $v=1$ into \eqref{Eq:IntByParts} yields:
\begin{equation}\label{Eq:CellAverageDG}
    \int_{I_{j}}\pd{\left(\sqrtgm\,\bU\right)}{t}\,dx^{1}=-\left[\sqrtgm\,\hat{\bF^{1}}\Big|_{x^{1}_{H}}-\sqrtgm\,\hat{\bF^{1}}\Big|_{x^{1}_{L}}\right]+\int_{I_{j}}\sqrtgm\,\bQ\,dx^{1}.
\end{equation}
Note that the volume-term has dropped out because the derivative of a constant is equal to zero.

We define the cell-average of a quantity, $\bX=\bX\left(x^{1},t\right)$, as:
\begin{equation}
    \ol{\bX}\equiv\f{1}{\Delta V_{j}}\int_{I_{j}}\bX\,\sqrtgm\,dx^{1}.
\end{equation}

\red{NEW ASSUMPTION:} We assume that the spatial three-metric is explicitly independent of time. This allows us to pull the metric determinant out of the first integral, yielding for \eqref{Eq:CellAverageDG}:
\begin{equation}
    \f{d\,\ol{\bU}}{dt}=-\f{1}{\Delta V_{j}}\left[\sqrtgm\,\hat{\bF^{1}}\Big|_{x^{1}_{H}}-\sqrtgm\,\hat{\bF^{1}}\Big|_{x^{1}_{L}}\right]+\ol{\bQ}.
\end{equation}

\red{NEW ASSUMPTION:} We now specialize this to using the forward-Euler time-stepping algorithm, yielding:

\begin{equation}
    \ol{\bU}^{n+1}=\ol{\bU}^{n}-\f{\Delta t^{n}_{j}}{\Delta V_{j}}\left[\sqrtgm\,\hat{\bF^{1}}\Big|_{x^{1}_{H}}-\sqrtgm\,\hat{\bF^{1}}\Big|_{x^{1}_{L}}\right]^{n}+\Delta t^{n}_{j}\,\ol{\bQ}^{n}
\end{equation}
\blue{NOTE:} Since the spatial three-metric is explicitly independent of time, we don't need to specify the time-step at which the volume is computed (i.e. we don't have to write $\Delta V^{n}_{j}$).

Now we define a parameter $\ve\in\left(0,1\right)$ a la \citet{ZS2011b} and re-write the above equation as:
\begin{align}
    \ol{\bU}^{n+1}&=\ve\left\{\ol{\bU}^{n}-\f{\Delta t^{n}_{j}}{\ve\,\Delta V_{j}}\left[\sqrtgm\,\hat{\bF^{1}}\Big|_{x^{1}_{H}}-\sqrtgm\,\hat{\bF^{1}}\Big|_{x^{1}_{L}}\right]^{n}\right\}+\left(1-\ve\right)\left\{\ol{\bU}^{n}+\f{\Delta t^{n}_{j}}{1-\ve}\,\ol{\bQ}^{n}\right\}\\
    &=\ve\,\ol{\bH}_{1}+\left(1-\ve\right)\ol{\bH}_{2},
\end{align}
where
\begin{equation}\label{Eq:H1}
    \ol{\bH}_{1}\equiv\ol{\bU}^{n}-\f{\Delta t^{n}_{j}}{\ve\,\Delta V_{j}}\left[\sqrtgm\,\hat{\bF^{1}}\Big|_{x^{1}_{H}}-\sqrtgm\,\hat{\bF^{1}}\Big|_{x^{1}_{L}}\right]^{n},
\end{equation}
and
\begin{equation}
    \ol{\bH}_{2}\equiv\ol{\bU}^{n}+\f{\Delta t^{n}_{j}}{1-\ve}\,\ol{\bQ}^{n}.
\end{equation}
\red{NEW ASSUMPTION:} We assume that $\ol{\bU}^{n}\in\cG$, as defined in \citet{Mignone2005}.

Assuming that $\ol{\bU}^{n}\in\cG$, we now seek to derive the conditions that guarantee $\ol{\bU}^{n+1}\in\cG$.

\subsubsection{The numerical flux term: $\ol{\bH}_{1}$}

We start by numerically computing the cell-average using quadrature with the Gauss-Lobatto quadrature rule. We assume that the DG approximation polynomial for the conserved variables is of order $k$, and that the order of the approximate solution is of order $k+d$, where $d$ is an integer that depends on the metric determinant. For the case of Cartesian coordinates, $d=0$ (because $\sqrtgm\sim x^{0}$), and for spherical-polar coordinates in spherical symmetry, $d=2$ (because $\sqrtgm\sim r^{2}$). Gauss-Lobatto integration will give an exact result if we choose a sufficiently high number, $M$, of quadrature points:
\begin{equation}
    2\,M-3\geq k+d\implies M\geq\f{k+d+3}{2}.
\end{equation}

\blue{NOTE:} We do not use this restriction in the code. We simply take $M$ equal to the number of quadrature points (which is the same as the number of interpolation points). The difference will be accounted for by the presence of the CFL number.

\blue{NOTE:} We now drop the superscript $n$ for the rest of this subsection.

Assuming that we choose a sufficient number of points, we can write the cell-average as:
\begin{align}
    \ol{\bU}=\f{1}{\Delta V_{j}}\sum\limits_{q=1}^{M}w_{q}\,\bU_{q}\,\sqrtgm_{q}\,\Delta x_{j}&=\f{\Delta x_{j}}{\Delta V_{j}}\sum\limits_{q=2}^{M-1}w_{q}\,\bU_{q}\,\sqrtgm_{q}+\f{\Delta x_{j}}{\Delta V_{j}}\,w_{1}\,\bU_{1}\,\sqrtgm_{1}+\f{\Delta x_{j}}{\Delta V_{j}}\,w_{M}\,\bU_{M}\,\sqrtgm_{M}\\
    &=\f{\Delta x_{j}}{\Delta V_{j}}\sum\limits_{q=2}^{M-1}w_{q}\,\bU_{q}\,\sqrtgm_{q}+\f{\Delta x_{j}}{\Delta V_{j}}\,w_{1}\,\bU^{+}_{L}\,\sqrtgm_{L}+\f{\Delta x_{j}}{\Delta V_{j}}\,w_{M}\,\bU^{-}_{H}\,\sqrtgm_{H},\label{Eq:CellAverageGL}
\end{align}
where $w_{q}$ are the Gauss-Lobatto quadrature weights and $\bU_{q}=\bU\left(x_{q}\right)$, and $\sqrtgm_{q}=\sqrt{\gamma\left(x_{q}\right)}$. The quantity $\bU^{+}_{L}$ refers to the vector of conserved variables evaluated at the lower interface, but on the higher side, so that it is evaluated \textit{in} the $\jth$ cell. Similarly for $\bU^{-}_{H}$.

Our approach is to use the end-points to balance the troublesome terms in the numerical fluxes.

\red{NEW ASSUMPTION:} We now specialize to the local Lax-Friedrichs flux:
\begin{align}
    \hat{\bF}^{1}\Big|_{x^{1}_{L}}&=\hat{\bF}^{1}\left(\bU^{+}_{L},\bU^{-}_{L}\right)=\f{1}{2}\left[\bF^{1}\left(\bU^{+}_{L}\right)+\bF^{1}\left(\bU^{-}_{L}\right)-\alpha_{L}\left(\bU_{L}^{+}-\bU_{L}^{-}\right)\right]\\
    &=\f{1}{2}\left\{-\alpha_{L}\left[\bU^{+}_{L}-\f{1}{\alpha_{L}}\,\bF^{1}\left(\bU^{+}_{L}\right)\right]+\alpha_{L}\left[\bU^{-}_{L}+\f{1}{\alpha_{L}}\,\bF^{1}\left(\bU^{-}_{L}\right)\right]\right\},
\end{align}
and
\begin{align}
    \hat{\bF}^{1}\Big|_{x^{1}_{H}}&=\hat{\bF}^{1}\left(\bU^{+}_{H},\bU^{-}_{H}\right)=\f{1}{2}\left[\bF^{1}\left(\bU^{+}_{H}\right)+\bF^{1}\left(\bU^{-}_{H}\right)-\alpha_{H}\left(\bU_{H}^{+}-\bU_{H}^{-}\right)\right]\\
    &=\f{1}{2}\left\{-\alpha_{H}\left[\bU^{+}_{H}-\f{1}{\alpha_{H}}\,\bF^{1}\left(\bU^{+}_{H}\right)\right]+\alpha_{H}\left[\bU^{-}_{H}+\f{1}{\alpha_{H}}\,\bF^{1}\left(\bU^{-}_{H}\right)\right]\right\},
\end{align}
where $\alpha_{H}=\text{max}\left(\alpha_{j},\alpha_{j+1}\right)$ and $\alpha_{L}=\text{max}\left(\alpha_{j-1},\alpha_{j}\right)$ are the largest (in magnitude) wavespeeds as given by the flux-Jacobian.
Now we substitute these expressions along with \eqref{Eq:CellAverageGL} into \eqref{Eq:H1}:
\begin{align}
    \ol{\bH}_{1}=&\f{\Delta x_{j}}{\Delta V_{j}}\sum\limits_{q=2}^{M-1}w_{q}\,\bU_{q}\,\sqrtgm_{q}+\f{\Delta x_{j}}{\Delta V_{j}}\,w_{1}\,\bU^{+}_{L}\,\sqrtgm_{L}+\f{\Delta x_{j}}{\Delta V_{j}}\,w_{M}\,\bU^{-}_{H}\,\sqrtgm_{H}\\
    &-\f{\Delta t_{j}}{\ve\,\Delta V_{j}}\left[\sqrtgm_{H}\f{1}{2}\left\{-\alpha_{H}\left[\bU^{+}_{H}-\f{1}{\alpha_{H}}\,\bF^{1}\left(\bU^{+}_{H}\right)\right]+\alpha_{H}\left[\bU^{-}_{H}+\f{1}{\alpha_{H}}\,\bF^{1}\left(\bU^{-}_{H}\right)\right]\right\}\right]\\
    &+\f{\Delta t_{j}}{\ve\,\Delta V_{j}}\left[\sqrtgm_{L}\f{1}{2}\left\{-\alpha_{L}\left[\bU^{+}_{L}-\f{1}{\alpha_{L}}\,\bF^{1}\left(\bU^{+}_{L}\right)\right]+\alpha_{L}\left[\bU^{-}_{L}+\f{1}{\alpha_{L}}\,\bF^{1}\left(\bU^{-}_{L}\right)\right]\right\}\right].
\end{align}
Now we combine terms with common factors of the metric determinant:
\begin{align}
    \ol{\bH}_{1}=&\f{\Delta x_{j}}{\Delta V_{j}}\sum\limits_{q=2}^{M-1}w_{q}\,\bU_{q}\,\sqrtgm_{q}\\
    &+\f{\sqrtgm_{L}}{\Delta V_{j}}\left\{\Delta x_{j}\,w_{1}\,\bU^{+}_{L}+\f{\Delta t_{j}\,\alpha_{L}}{2\,\ve}\left(-\left[\bU^{+}_{L}-\f{1}{\alpha_{L}}\,\bF^{1}\left(\bU^{+}_{L}\right)\right]+\left[\bU^{-}_{L}+\f{1}{\alpha_{L}}\,\bF^{1}\left(\bU^{-}_{L}\right)\right]\right)\right\}\\
    &+\f{\sqrtgm_{H}}{\Delta V_{j}}\left\{\Delta x_{j}\,w_{M}\,\bU^{-}_{H}-\f{\Delta t_{j}\,\alpha_{H}}{2\,\ve}\left(-\left[\bU^{+}_{H}-\f{1}{\alpha_{H}}\,\bF^{1}\left(\bU^{+}_{H}\right)\right]+\left[\bU^{-}_{H}+\f{1}{\alpha_{H}}\,\bF^{1}\left(\bU^{-}_{H}\right)\right]\right)\right\}.
\end{align}
Next we factor out $\Delta x_{j}$ and the quadrature weights, yielding:
\begin{align}
    \ol{\bH}_{1}=&\f{\Delta x_{j}}{\Delta V_{j}}\sum\limits_{q=2}^{M-1}w_{q}\,\bU_{q}\,\sqrtgm_{q}\\
    &+\f{\sqrtgm_{L}\,\Delta x_{j}\,w_{1}}{\Delta V_{j}}\left\{\bU^{+}_{L}+\f{\Delta t_{j}\,\alpha_{L}}{2\,\ve\,\Delta x_{j}\,w_{1}}\left(-\left[\bU^{+}_{L}-\f{1}{\alpha_{L}}\,\bF^{1}\left(\bU^{+}_{L}\right)\right]+\left[\bU^{-}_{L}+\f{1}{\alpha_{L}}\,\bF^{1}\left(\bU^{-}_{L}\right)\right]\right)\right\}\\
    &+\f{\sqrtgm_{H}\,\Delta x_{j}\,w_{M}}{\Delta V_{j}}\left\{\bU^{-}_{H}-\f{\Delta t_{j}\,\alpha_{H}}{2\,\ve\,\Delta x_{j}\,w_{M}}\left(-\left[\bU^{+}_{H}-\f{1}{\alpha_{H}}\,\bF^{1}\left(\bU^{+}_{H}\right)\right]+\left[\bU^{-}_{H}+\f{1}{\alpha_{H}}\,\bF^{1}\left(\bU^{-}_{H}\right)\right]\right)\right\}.
\end{align}
Next we re-write the $\bU^{+}_{L}$ and $\bU^{-}_{H}$ that appear with the flux terms:
\begin{align}
    \bU^{+}_{L}&=2\,\bU^{+}_{L}-\bU^{+}_{L}\\
    \bU^{-}_{H}&=2\,\bU^{-}_{H}-\bU^{-}_{H}.
\end{align}
This gives:
\begin{align}
    \ol{\bH}_{1}=&\f{\Delta x_{j}}{\Delta V_{j}}\sum\limits_{q=2}^{M-1}w_{q}\,\bU_{q}\,\sqrtgm_{q}\\
    &+\f{\sqrtgm_{L}\,\Delta x_{j}\,w_{1}}{\Delta V_{j}}\left\{\bU^{+}_{L}+\f{\Delta t_{j}\,\alpha_{L}}{2\,\ve\,\Delta x_{j}\,w_{1}}\left(-\left[2\,\bU^{+}_{L}-\bU^{+}_{L}-\f{1}{\alpha_{L}}\,\bF^{1}\left(\bU^{+}_{L}\right)\right]+\left[\bU^{-}_{L}+\f{1}{\alpha_{L}}\,\bF^{1}\left(\bU^{-}_{L}\right)\right]\right)\right\}\\
    &+\f{\sqrtgm_{H}\,\Delta x_{j}\,w_{M}}{\Delta V_{j}}\left\{\bU^{-}_{H}-\f{\Delta t_{j}\,\alpha_{H}}{2\,\ve\,\Delta x_{j}\,w_{M}}\left(-\left[\bU^{+}_{H}-\f{1}{\alpha_{H}}\,\bF^{1}\left(\bU^{+}_{H}\right)\right]+\left[2\,\bU^{-}_{H}-\bU^{-}_{H}+\f{1}{\alpha_{H}}\,\bF^{1}\left(\bU^{-}_{H}\right)\right]\right)\right\}.
\end{align}
This allows us to write the expression with factors similar to those in \citet{Qin2016}. We find:
\begin{align}
    \ol{\bH}_{1}=&\f{\Delta x_{j}}{\Delta V_{j}}\sum\limits_{q=2}^{M-1}w_{q}\,\bU_{q}\,\sqrtgm_{q}\\
    &+\f{\sqrtgm_{L}\,\Delta x_{j}\,w_{1}}{\Delta V_{j}}\left\{\bU^{+}_{L}\left(1-\f{\Delta t_{j}\,\alpha_{L}}{\ve\,\Delta x_{j}\,w_{1}}\right)+\f{\Delta t_{j}\,\alpha_{L}}{2\,\ve\,\Delta x_{j}\,w_{1}}\left(\left[\bU^{+}_{L}+\f{1}{\alpha_{L}}\,\bF^{1}\left(\bU^{+}_{L}\right)\right]+\left[\bU^{-}_{L}+\f{1}{\alpha_{L}}\,\bF^{1}\left(\bU^{-}_{L}\right)\right]\right)\right\}\\
    &+\f{\sqrtgm_{H}\,\Delta x_{j}\,w_{M}}{\Delta V_{j}}\left\{\bU^{-}_{H}\left(1-\f{\Delta t_{j}\,\alpha_{H}}{\ve\,\Delta x_{j}\,w_{M}}\right)+\f{\Delta t_{j}\,\alpha_{H}}{2\,\ve\,\Delta x_{j}\,w_{M}}\left(\left[\bU^{+}_{H}-\f{1}{\alpha_{H}}\,\bF^{1}\left(\bU^{+}_{H}\right)\right]+\left[\bU^{-}_{H}-\f{1}{\alpha_{H}}\,\bF^{1}\left(\bU^{-}_{H}\right)\right]\right)\right\}.
\end{align}
All of the terms in the square brackets are similar the the $\bH$ quantities in \citet{Qin2016} and therefore belong to the set of admissible states, provided that:
\begin{equation}
    \alpha_{L/H}=\alpha^{*}\geq\f{\left|v^{1}\right|\left(h+1-2\,h\,\tau\right)\,W^{2}+\sqrt{\tau^{4}\left(h-1\right)^{2}+\tau^{2}\left(h-1\right)\left(h+1-2\,h\,\tau\right)}}{W^{2}\left(h+1-2\,h\,\tau\right)+\tau^{2}\left(h-1\right)},
\end{equation}
where $h$ is the relativistic specific enthalpy and
\begin{equation}
    \tau\equiv\f{\Gamma-1}{\Gamma},
\end{equation}
where $\Gamma$ is the adiabatic index.

We see that the expressions in the curly brackets are convex combinations (given a restriction on $\Delta t_{j}$), because the coefficients sum to unity. Since the quadrature weights are symmetric (so $w_{1}=w_{M}\equiv w_{GL}$), we find that the condition for $\ol{\bH}_{1}\in\cG$ is a time-step restriction:
\begin{equation}
\Delta t_{j}<\ve\,\Delta x_{j}\,w_{GL}\,\text{min}\left(\f{1}{\alpha_{L}},\f{1}{\alpha_{H}},\f{1}{\alpha^{*}}\right)
\end{equation}
Since we want a time-step that is constant for all elements, we choose:
\begin{equation}
\Delta t<\ve\,w_{GL}\,\text{min}_{j}\left(\f{\Delta x_{j}}{\text{max}\left(\alpha_{L},\alpha_{H},\alpha^{*}\right)}\right).
\end{equation}

\red{NEW ASSUMPTION:} In order for this to work, we also demand that all of the $\bU_{q}$ are within physical bounds.

\blue{NOTE:} We see the effect of the high-order approximation in the presence of the quadrature end-point weight $w_{GL}$. As the order increases, $w_{GL}$ decreases, thus making a tighter restriction on the time-step.

\blue{NOTE:} It is worth noting that this result is \textit{not} independent of the metric, because it is incorporated through the wave-speed in the numerical flux.