TITLE: Solving the differential equation $(x^2-y^2)y' - 2xy = 0$.
QUESTION [7 upvotes]: I am trying to solve the equation
$$
(x^2-y^2)y' - 2xy = 0.
$$
I have rearranged to get
$$
y' = f(x,y)
$$
where
$$
f(x,y) = \frac{2xy}{x^2-y^2}.
$$
From here I tried to use a trick that I learned from class where we set $x=\frac{y}{x}$ and write
$$
\frac{z'}{f(1,z)-z} = \frac{1}{x}.
$$
After doing a calculation I have that
$$
\frac{z'}{f(1,z)-z} = z'\frac{(1-z^2)}{(z^3+z)}.
$$
From here I would like to use the fact that
$$
z'\frac{(1-z^2)}{(z^3+z)} = \frac{1}{x}
$$
and integrate both sides. However, I'm stuck at integrating the left-hand side.
How can I integrate the left-hand side, or is there is a better way to solve this equation? Thanks.

REPLY [0 votes]: You don't need to do any of that. This is an exact differential equation. The solution has the form $$F(x, y) = C$$ where $$\frac{\partial F}{\partial x} = 2xy$$ and $$\frac{\partial F}{\partial y} = x^2 - y^2$$


TITLE: $I = \int_{- \infty}^\infty \delta (n - \|\mathbf{x}\|^2) \, \mathrm d \mathbf{x} $ should not diverge
QUESTION [4 upvotes]: I'm having trouble evaluating this integral:
$$I = \int_{-\infty}^\infty \delta (n - \|\mathbf{x}\|^2) \,\mathrm d \mathbf{x} $$
where $\delta(x)$ is Dirac delta function, $\mathbf x$ is the real $n$-dimensional vector $(x_1,\ldots,x_n)$, and $\|\mathbf{x}\|^2 = \sum_{i=1}^n x_i^2$. Here I use the short-hand notation:
$$\int_{-\infty}^\infty\mathrm d \mathbf{x} = \int_{-\infty}^\infty\mathrm d x_1 \cdots \int_{-\infty}^\infty\mathrm d x_n$$
Here is what I tried to do. Using the integral representation of Dirac's delta function $\delta (x) = \int_{- \infty}^{\infty} \frac{d \lambda}{2 \pi} e^{i \lambda x}$, I get
$$I = \int_{- \infty}^\infty d \mathbf{x} \int_{-\infty}^\infty
\frac{d\lambda}{2\pi} \mathrm e^{i\lambda(n - \| \mathbf{x} \|^2)} = \int_{- \infty}^\infty \frac{d\lambda}{2\pi} e^{-i \lambda n} \left( \int_{- \infty}^\infty e^{i\lambda x^2} \, dx \right)^n$$
I evaluated the inner integral with Mathematica:
$$\int_{- \infty}^{\infty} e^{i\lambda x^2} \, dx = \sqrt{\frac{\pi}{2}} \frac{1 +i \operatorname{sgn}(\lambda)}{\sqrt{|\lambda|}}$$
But then when I try to substitute this I get a diverging integral in $\lambda$.
What did I do wrong?
Note that the original integral is well behaved. Using polar coordinates it can be shown that $I = n^{n/2-1} \pi^{n/2} / \Gamma(n/2)$ (see  https://doi.org/10.1093/qmath/12.1.165, or my answer below). Some step of my derivation leads to a fictitious divergence.
Update: @user587192's answer found the error in my calculation. I cannot exchange the order of integrations on $x$ and $\lambda$. My next question is whether there is a way to rescue this calculation? Manipulations with the Fourier transform of the Dirac delta are very convenient in more complicated situations. This is evident from the algebraic complexity of the spherical coordinates appraoch. Is there way to exploit the convenience of the Fourier representation of the Dirac delta here?

REPLY [0 votes]: There is a trick one can do to use the Fourier transform and still have converging integrals. The trick is to multiply the integrand by $\mathrm e^{(1-||\mathbf x||^2)} = 1$. Then
$$\begin{aligned}
  \int_{- \infty}^{\infty} \delta (1 - ||\mathbf x||^2) \mathrm d
  \mathbf x & = \int_{- \infty}^{\infty} \mathrm d \mathbf x
  \int_{- \infty}^{\infty} \frac{\mathrm d \lambda}{2 \pi} \mathrm e^{(1
  +\mathfrak{i} \lambda) (1 - ||\mathbf x||^2)}\\
  & = \int_{- \infty}^{\infty} \frac{\mathrm d \lambda}{2 \pi} \mathrm e^{1
  +\mathfrak{i} \lambda} \left( \int_{- \infty}^{\infty} \mathrm e^{- (1
  +\mathfrak{i} \lambda) x^2} \mathrm dx \right)^N\\
  & = \int_{- \infty}^{\infty} \frac{\mathrm d \lambda}{2 \pi} \mathrm e^{1
  +\mathfrak{i} \lambda} \left( \frac{\pi}{1 +\mathfrak{i} \lambda} \right)^{N
  / 2}\\
  & = \pi^{N / 2} / \Gamma (N / 2)
\end{aligned}$$
which is the correct result. Here all intermediate integrals converge and the integration order can be exchanged.


TITLE: Calculate eigenvalues as a function
QUESTION [0 upvotes]: I don't understand these two questions, someone can explain how to solve them?
Thanks in advance.
in problem 2, I tried to solve it by this way:

REPLY [3 votes]: The eigenvalues are the complex numbers $\lambda$ such that $$\det(A-\lambda I) = 0.$$ We see $$\det(A - \lambda I ) =\left\lvert \begin{matrix} 1-\lambda & q \\ 4 & 2-\lambda \end{matrix} \right\rvert = (\lambda - 2)(\lambda - 1) -4q = \lambda^2 - 3\lambda +(2- 4q).$$ Solving for the roots gives $$\lambda = \tfrac 1 2 \left( 3 \pm \sqrt{9 - 4(2 - 4q)} \right) = \tfrac 1 2 \left( 3 \pm \sqrt{1 + 16q} \right).$$ This answers (1). To answer (2), we cna just set $\lambda = 5$ and solve for $q$. If $\lambda = 5$, then we need $$10 = 3 + \sqrt{1+16q} \implies 7 = \sqrt{1+16q} \implies 49 = 1 + 16q \implies 16q = 48 \implies q =3.$$