Solve $-\frac{\partial }{\partial x} (-\gamma p^* - \frac{\sigma^2}{2} \frac{\partial }{\partial x} p^* ) = 0$ I am trying to solve the following Fokker plank equation (partial differential equation)
\begin{align*}
-\frac{\partial }{\partial x} (-\gamma p^*(x,t) - \frac{\sigma^2}{2}  \frac{\partial }{\partial x} p^*(x,t) ) = 0
\end{align*}
or by changing the notation slightly by setting $p^* = p^*(x,t)$
\begin{align*}
-\frac{\partial }{\partial x} (-\gamma p^* - \frac{\sigma^2}{2}  \frac{\partial }{\partial x} p^* ) = 0
\end{align*}
so that I have it in terms of $p$ in the form (I am trying to get to this result explicitly)
\begin{align*}
p^* = C e^{\frac{-\gamma x^2}{\sigma^2}}
\end{align*}
where $C$ represents some constant.
My attempt (not complete at the end)
\begin{align*}
-\frac{\partial }{\partial x} (-\gamma p^* - \frac{\sigma^2}{2}  \frac{\partial }{\partial x} p^* ) = 0 \\
\frac{\partial }{\partial x} (-\gamma p^* - \frac{\sigma^2}{2}  \frac{\partial }{\partial x} p^* ) = 0
\end{align*}
Since our function does not depend on x the value should be equal to some constant $C_1$
\begin{align}
 (-\gamma p^* - \frac{\sigma^2}{2}  \frac{\partial }{\partial x} p^* ) = C_1 \\
  - \frac{\sigma^2}{2}  \frac{\partial }{\partial x} p^*  = C_1 + \gamma p^* \\
   \frac{\partial }{\partial x} p^*  = - \frac{2}{\sigma^2}  \left( C_1 + \gamma p^* \right)
\end{align}
Please can you show more explicitly how to get to the correct result $p^* = C e^{\frac{-\gamma x^2}{\sigma^2}}$.
 A: You have two errors at your current stage. First, note that you have already neglected the time derivative in the Fokker-Planck equation which is equivalent to taking the limit $t \rightarrow \infty$ (steady-state conditions). There is no time variable in the resulting problem, so you have an ordinary differential equation.
Second, you are missing a factor of $x$ for the standard Ornstein-Uhlenbeck Process. The correct Fokker-Planck equation for a steady-state Ornstein-Uhlenbeck process is:
$$
-\frac{d}{dx} \Big[-\gamma x p^*(x) - \frac{\sigma^2}{2}  \frac{d }{d x} p^\ast(x) \Big] = 0,
$$
and integrating once gives
$$ -\gamma x p^\ast(x) -   \frac{\sigma^2}{2}  \frac{d }{d x} p^\ast(x)  = C, $$
where $C$ is some constant.
If your distribution $p$ is to be normalizable, you need to require
$$ \lim_{x\rightarrow \pm \infty} p^\ast = 0, $$
which implies $C=0$.
Therefore we have
$$ \frac{dp^\ast}{p^\ast} = -\frac{2 \gamma x}{\sigma^2}  dx$$
which trivially integrates for
$$ p^\ast(x) = A \exp\big[-\gamma x^2/\sigma^2 \big],$$
where $A$ is a constant. You can the normalize with the well-known / extremely important integral
$$ \sqrt{\pi} = \int_{-\infty}^\infty e^{-x^2} dx.$$
