x,a,b,c,d=var('x,a,b,c,d')assume(a>0)assume(b>0)assume(c>0)assume(d>0)#assume((C*R^2-4*L) > 0)p=function('p')(x)ed = ((a*x-b)^2)*diff(p,x,2)+(c*x-d)*diff(p,x,1)==1sol=desolve(ed,p,ivar=x)show(sol)forget()
$\displaystyle K_{2} + \int {\left(K_{1} e^{\left(\frac{b c}{a^{3} x - a^{2} b}\right)} + e^{\left(\frac{b c}{a^{3} x - a^{2} b}\right)} \int \frac{e^{\left(-\frac{b c}{a^{3} x - a^{2} b} + \frac{d}{a^{2} x - a b} + \frac{c \log\left(a x - b\right)}{a^{2}}\right)}}{a^{2} x^{2} - 2 \, a b x + b^{2}}\,{d x}\right)} e^{\left(-\frac{d}{a^{2} x - a b} - \frac{c \log\left(a x - b\right)}{a^{2}}\right)}\,{d x}$
# declara variáveis simbólicas: variável independente e parâmetrosx,a,b,c,d=var('x,a,b,c,d')# impõe que todos os parâmetros são estritamente positivosassume(a>0)assume(b>0)assume(c>0)assume(d>0)# declara a função incógnitap=function('p')(x)# define a equação diferencialed = ((a*x+b)^2)*diff(p,x,2)+(c*x+d)*diff(p,x,1)==1# obtém a solução da EDO e exibesol=desolve(ed,p,ivar=x)show(sol)# simplifica a solução (elimina os logaritmos, essencialmente) e exibesol1=sol.canonicalize_radical()show(sol1)forget()
$\displaystyle K_{2} + \int {\left(K_{1} e^{\left(\frac{d}{a^{2} x + a b}\right)} + e^{\left(\frac{d}{a^{2} x + a b}\right)} \int \frac{e^{\left(\frac{b c}{a^{3} x + a^{2} b} - \frac{d}{a^{2} x + a b} + \frac{c \log\left(a x + b\right)}{a^{2}}\right)}}{a^{2} x^{2} + 2 \, a b x + b^{2}}\,{d x}\right)} e^{\left(-\frac{b c}{a^{3} x + a^{2} b} - \frac{c \log\left(a x + b\right)}{a^{2}}\right)}\,{d x}$
$\displaystyle K_{2} + \int \frac{{\left(K_{1} e^{\left(\frac{d}{a^{2} x + a b}\right)} + e^{\left(\frac{d}{a^{2} x + a b}\right)} \int \frac{{\left(a x + b\right)}^{\frac{c}{a^{2}}} e^{\left(\frac{b c - a d}{a^{3} x + a^{2} b}\right)}}{a^{2} x^{2} + 2 \, a b x + b^{2}}\,{d x}\right)} e^{\left(-\frac{b c}{a^{3} x + a^{2} b}\right)}}{{\left(a x + b\right)}^{\frac{c}{a^{2}}}}\,{d x}$