Suppose I have a given series $A(z)=\Sigma a_nz^n$
I want to solve a differential equation for $B(z)$ in terms of coefficients of $a_n$ as a series. Possibly with ansatz $B(z)=\Sigma b_nz^n$ or other form.
In other words, I want to get $b_n$ in terms of $a_n$.
My equation is this $\frac{dB}{dz}=-z(A+B)(B+1)$
How do I let Mathematica to do this for me?
So far I have tried defining the series using Sum and SolveAlways.
But it seems completely wrong. And I believe there must be a good way of doing this on Mathematica.
Additional question:
ord = 3;
mzi = M - Exp[-z]*(Sum[a[n] (1/z)^n, {n, 0, ord}] + O[z]^(ord + 1));
pzi = Exp[-z]*(Sum[p[n] (1/z)^n, {n, 0, ord}] + O[z]^(ord + 1));
With[{mzii = mzi, pzii = pzi},
SolveAlways[D[pzii, z] == -\[Epsilon]^2/z^2 (D[mzii, z]/(4 Pi*z^2) + pzii)
(4*Pi*z^3*pzii + mzii), z]]
And I want to solve for p[n] in terms of a[n], but I get an error message saying: not a polynomial.
Sum[]+SolveAlways[]:With[{af = Sum[a[n] z^n, {n, 0, 12}] + O[z]^13, bf = Sum[b[n] z^n, {n, 0, 12}] + O[z]^13}, SolveAlways[D[bf, z] == -z (af + bf) (bf + 1), z]]– J. M.'s missing motivation Aug 12 '17 at 03:12O[]; since you're looking at asymptotic series, tryO[z, ∞]^(ord + 1). Second, you might want to do a little simplification first and see if you can reformulate to avoid the exponential factor; that messesSolveAlways[]up. – J. M.'s missing motivation Aug 13 '17 at 16:31