I have this differential integral equation from a physics problem $y'(x)=-k\frac{y^2(x)}{x^2}\int_0^xt^2y(t)\,dt$ and i dont know how to solve such equation.
Edit 3 (the third time's a charm):
Comment: I was wrong at the time of calculating $g(r)$ so the differential equation changes a lot.
This problem arrives when i want to calculate a radial density of a sphere that compresses by its own gravity
I start with my equation of state where i assume a isotermal process:
$dV = \frac{dV}{dP}dP$ (1)
$\frac{dV}{dP}=-VB$ (2)
B is the reciprocal of bulk modulus, density and volume are inverse proportional then i get from eq (2):
$\frac{d\delta}{dP}=\delta B$ (3)
where $\delta(r)$ is the density, then i know that:
$dP=\delta(r)g(r)dr$ (4)
$g(r)$ the acceleration inside the planet which is:
$g(r)=-G\frac{M(r)}{r^2}$ (5)
To get $M(r)$ i integrate the density multiplied by the volume of a sphere eq (6).
$M(r) =4\pi\int_0^r t^2\delta(t)dt$ (6)
Back to eq (5) using (6) i get:
$g(r)=-\frac{4\pi G}{r^2}\int_0^r t^2\delta(t)dt$ (7)
from eq (4) and (7) i get:
$\frac{dP}{dr}=-\frac{4\pi G}{r^2}\delta(r)\int_0^r t^2\delta(t)dt$ (8)
Since in the eq (3) i've $\delta(P(r))$ i can use the chain rule to get $\frac{d\delta(r)}{dr}$
$\frac{d\delta}{dr}\frac{dr}{dP}=\delta B$ (9)
using a forbidden method i get from eq (9):
$\frac{d\delta}{dr}=\frac{dP}{dr}\delta B$ (10)
Using eq (10) and (8) i finally get:
$\frac{d\delta}{dr}=-\frac{4\pi BG}{r^2}\delta(r)^2\int_0^r t^2\delta(t)dt$ (11)
which is my initial problem if i set $k=\frac{4}{3}\pi BG$, $y=\delta(t)$ and $x=r$.
$y(x)' = -k \frac{y(x)^2}{x^2}\int_0^xt^2y(t)dt$ (12)
Doing what Cameron Williams said in a comment, i can isolate the integral and differentiate in booth sides:
$-\frac{y'x^2}{ky^2}=\int_0^xt^2y(t)dt$
$(-\frac{y'x^2}{ky^2})'=(\int_0^xt^2y(t)dt)'$
$-\frac{(y''x^2+y'2x)y^2-2yy'^2x^2}{ky^4}=x^2y$
$-y''xy+2y'y+2y'^2x=kxy^4$ (13)
Now i get a non linear ordinary differential equation of order 2, and it looks awful so i will use some numeric method to solve it, but i dont lose hope that it might have a weird close form.
Aside from that equation i've another question and its what happen in the case $x$ or $r =0$ because i should get the maximum density, but if i evaluate everything at 0 i get get from eq (13) and (12)
$y'(0)=0$
$y''(0)=-ky^3(0)$
So i dont have a numerical value of the central density for doing a numerical integration, i am missing something?