login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Test 1: solve a simple nonlinear homogeneous differential equation

fricas
y := operator y

\label{eq1}y(1)
fricas
deq1 := D(y(x),x) = 9 - y(x)^2

\label{eq2}{{y_{\ }^{,}}\left({x}\right)}={-{{y \left({x}\right)}^{2}}+ 9}(2)
Type: Equation(Expression(Integer))
fricas
solve(deq1,y,x)

\label{eq3}{-{\log \left({{y \left({x}\right)}+ 3}\right)}+{\log \left({{y \left({x}\right)}- 3}\right)}+{6 \  x}}\over 6(3)
Type: Union(Expression(Integer),...)

Test 2: solve a class of simple nonlinear homogeneous differential equations

fricas
deq2a := D(y(x),x) = c - p*y(x)^2

\label{eq4}{{y_{\ }^{,}}\left({x}\right)}={-{p \ {{y \left({x}\right)}^{2}}}+ c}(4)
Type: Equation(Expression(Integer))
fricas
xpr2b := solve(deq2a,y,x)

\label{eq5}{{\log \left({{{{\left({p \ {{y \left({x}\right)}^{2}}}+ c \right)}\ {\sqrt{c \  p}}}-{2 \  c \  p \ {y \left({x}\right)}}}\over{{p \ {{y \left({x}\right)}^{2}}}- c}}\right)}+{2 \  x \ {\sqrt{c \  p}}}}\over{2 \ {\sqrt{c \  p}}}(5)
Type: Union(Expression(Integer),...)
fricas
simplify(x-xpr2b)

\label{eq6}-{{\log \left({{{{\left({p \ {{y \left({x}\right)}^{2}}}+ c \right)}\ {\sqrt{c \  p}}}-{2 \  c \  p \ {y \left({x}\right)}}}\over{{p \ {{y \left({x}\right)}^{2}}}- c}}\right)}\over{2 \ {\sqrt{c \  p}}}}(6)
Type: Expression(Integer)

Test 3: find general solutions for nonlinear homogeneous differential equations

fricas
f := operator f

\label{eq7}f(7)
fricas
deq3 := D(y(x),x) = f(y(x))

\label{eq8}{{y_{\ }^{,}}\left({x}\right)}={f \left({y \left({x}\right)}\right)}(8)
Type: Equation(Expression(Integer))
fricas
solve(deq3,y,x)

\label{eq9}{\int^{
\displaystyle
{y \left({x}\right)}}{{1 \over{f \left({\%D}\right)}}\ {d \%D}}}- x(9)
Type: Union(Expression(Integer),...)

Test 4: integration

fricas
integrate(1/(1-x^2),x)

\label{eq10}{{\log \left({x + 1}\right)}-{\log \left({x - 1}\right)}}\over 2(10)
Type: Union(Expression(Integer),...)

Test 5: check result

fricas
xpr5 := (log(x+1)-log(x-1))/2

\label{eq11}{{\log \left({x + 1}\right)}-{\log \left({x - 1}\right)}}\over 2(11)
Type: Expression(Integer)
fricas
D(xpr5,x)

\label{eq12}-{1 \over{{{x}^{2}}- 1}}(12)
Type: Expression(Integer)

Test 6: check simplification

fricas
xpr6 := log(1+2/(x-1))/2

\label{eq13}{\log \left({{x + 1}\over{x - 1}}\right)}\over 2(13)
Type: Expression(Integer)
fricas
D(xpr6,x)

\label{eq14}-{1 \over{{{x}^{2}}- 1}}(14)
Type: Expression(Integer)

Test 7: Express y(x) as function of x (replacing y(x) with z)

fricas
eq7a := x = (log(z+1)-log(z-1))/2

\label{eq15}x ={{{\log \left({z + 1}\right)}-{\log \left({z - 1}\right)}}\over 2}(15)
Type: Equation(Expression(Integer))
fricas
solve(eq7a,z)

\label{eq16}\left[{z ={{-{{e}^{-{2 \  x}}}- 1}\over{{{e}^{-{2 \  x}}}- 1}}}\right](16)
Type: List(Equation(Expression(Integer)))
fricas
xpr7b := (1+exp(-2*z))/(1-exp(-2*z))

\label{eq17}{-{{e}^{-{2 \  z}}}- 1}\over{{{e}^{-{2 \  z}}}- 1}(17)
Type: Expression(Integer)
fricas
simplify(xpr7b)

\label{eq18}{-{{e}^{-{2 \  z}}}- 1}\over{{{e}^{-{2 \  z}}}- 1}(18)
Type: Expression(Integer)

Test 8: check simplified result

fricas
xpr8 := (1+exp(-2*x))/(1-exp(-2*x)) - (1+2/(exp(2*x)-1))

\label{eq19}{-{2 \ {{e}^{-{2 \  x}}}\ {{e}^{2 \  x}}}+ 2}\over{{{\left({{e}^{-{2 \  x}}}- 1 \right)}\ {{e}^{2 \  x}}}-{{e}^{-{2 \  x}}}+ 1}(19)
Type: Expression(Integer)
fricas
simplify(xpr8)

\label{eq20}0(20)
Type: Expression(Integer)

Test 9: check result by substitution in the DEQ

fricas
xpr9a := (1+2/(exp(2*x)-1))

\label{eq21}{{{e}^{2 \  x}}+ 1}\over{{{e}^{2 \  x}}- 1}(21)
Type: Expression(Integer)
fricas
xpr9b := D(xpr9a,x)

\label{eq22}-{{4 \ {{e}^{2 \  x}}}\over{{{{e}^{2 \  x}}^{2}}-{2 \ {{e}^{2 \  x}}}+ 1}}(22)
Type: Expression(Integer)
fricas
xpr9c := 1 - (xpr9a)^2

\label{eq23}-{{4 \ {{e}^{2 \  x}}}\over{{{{e}^{2 \  x}}^{2}}-{2 \ {{e}^{2 \  x}}}+ 1}}(23)
Type: Expression(Integer)

Test 10: finding the explicit solution for the deq in test 2

fricas
wcp := sqrt(c*p)

\label{eq24}\sqrt{c \  p}(24)
Type: Expression(Integer)
fricas
xpr10a := log(((p*z^2+c)*wcp-2*c*p*z)/(p*z^2-c))/(2*wcp)

\label{eq25}{\log \left({{{{\left({p \ {{z}^{2}}}+ c \right)}\ {\sqrt{c \  p}}}-{2 \  c \  p \  z}}\over{{p \ {{z}^{2}}}- c}}\right)}\over{2 \ {\sqrt{c \  p}}}(25)
Type: Expression(Integer)
fricas
solve(x = xpr10a,z)

\label{eq26}\begin{array}{@{}l}
\displaystyle
\left[{
\begin{array}{@{}l}
\displaystyle
z ={{\left(
\begin{array}{@{}l}
\displaystyle
{{\left({-{{{e}^{2 \  x \ {\sqrt{c \  p}}}}^{2}}+{{\sqrt{c \  p}}\ {{e}^{2 \  x \ {\sqrt{c \  p}}}}}}\right)}\ {\sqrt{{{c \ {{e}^{2 \  x \ {\sqrt{c \  p}}}}}-{c \ {\sqrt{c \  p}}}}\over{{p \ {{{e}^{2 \  x \ {\sqrt{c \  p}}}}^{3}}}-{3 \  p \ {\sqrt{c \  p}}\ {{{e}^{2 \  x \ {\sqrt{c \  p}}}}^{2}}}+{3 \  c \ {{p}^{2}}\ {{e}^{2 \  x \ {\sqrt{c \  p}}}}}-{c \ {{p}^{2}}\ {\sqrt{c \  p}}}}}}}- 
\
\
\displaystyle
c 
(26)
Type: List(Equation(Expression(Integer)))
fricas
eq10c := (p*z^2+c)*wcp-2*c*p*z

\label{eq27}{{\left({p \ {{z}^{2}}}+ c \right)}\ {\sqrt{c \  p}}}-{2 \  c \  p \  z}(27)
Type: Expression(Integer)
fricas
solve(eq10c=0,z)

\label{eq28}\left[{z ={c \over{\sqrt{c \  p}}}}, \:{z ={c \over{\sqrt{c \  p}}}}\right](28)
Type: List(Equation(Expression(Integer)))
fricas
xpr10d := p*wcp*(z-wcp/p)^2

\label{eq29}{{\left({p \ {{z}^{2}}}+ c \right)}\ {\sqrt{c \  p}}}-{2 \  c \  p \  z}(29)
Type: Expression(Integer)
fricas
simplify(xpr10d/eq10c)

\label{eq30}1(30)
Type: Expression(Integer)
fricas
xpr10e := (wcp/p)*(2/(1-exp(-2*wcp*x)/wcp)-1)

\label{eq31}{-{{\sqrt{c \  p}}\ {{e}^{-{2 \  x \ {\sqrt{c \  p}}}}}}-{c \  p}}\over{{p \ {{e}^{-{2 \  x \ {\sqrt{c \  p}}}}}}-{p \ {\sqrt{c \  p}}}}(31)
Type: Expression(Integer)
fricas
xpr10f := D(xpr10e,x)

\label{eq32}-{{4 \  c \ {\sqrt{c \  p}}\ {{e}^{-{2 \  x \ {\sqrt{c \  p}}}}}}\over{{{{e}^{-{2 \  x \ {\sqrt{c \  p}}}}}^{2}}-{2 \ {\sqrt{c \  p}}\ {{e}^{-{2 \  x \ {\sqrt{c \  p}}}}}}+{c \  p}}}(32)
Type: Expression(Integer)
fricas
xpr10g := c - p*(xpr10e)^2

\label{eq33}-{{4 \  c \ {\sqrt{c \  p}}\ {{e}^{-{2 \  x \ {\sqrt{c \  p}}}}}}\over{{{{e}^{-{2 \  x \ {\sqrt{c \  p}}}}}^{2}}-{2 \ {\sqrt{c \  p}}\ {{e}^{-{2 \  x \ {\sqrt{c \  p}}}}}}+{c \  p}}}(33)
Type: Expression(Integer)
fricas
simplify(xpr10f / xpr10g)

\label{eq34}1(34)
Type: Expression(Integer)

Test 11: non-homogeneous generalization: c as linear function of x

fricas
deq11a := D(y(x),x) = a*x + b - p*y(x)^2

\label{eq35}{{y_{\ }^{,}}\left({x}\right)}={-{p \ {{y \left({x}\right)}^{2}}}+{a \  x}+ b}(35)
Type: Equation(Expression(Integer))
fricas
solve(deq11a,y,x)

\label{eq36}\mbox{\tt "failed"}(36)
Type: Union("failed",...)

Test 12: non-homogeneous generalization: c as arbitrary function of x

fricas
c := operator c

\label{eq37}c(37)
fricas
deq12a := D(y(x),x) = c(x) - p*y(x)^2

\label{eq38}{{y_{\ }^{,}}\left({x}\right)}={-{p \ {{y \left({x}\right)}^{2}}}+{c \left({x}\right)}}(38)
Type: Equation(Expression(Integer))
fricas
solve(deq12a,y,x)

\label{eq39}\mbox{\tt "failed"}(39)
Type: Union("failed",...)

Test 13: guessing solution for deq12a

fricas
wpcx := sqrt(c(x))*sqrt(p)

\label{eq40}{\sqrt{p}}\ {\sqrt{c \left({x}\right)}}(40)
Type: Expression(Integer)
fricas
xpr13a := log((p*wpcx*(z-wpcx/p)^2)/(p*z^2-c(x)))/(2*wpcx)

\label{eq41}{\log \left({{{{\left(-{c \left({x}\right)}-{p \ {{z}^{2}}}\right)}\ {\sqrt{p}}\ {\sqrt{c \left({x}\right)}}}+{2 \  p \  z \ {c \left({x}\right)}}}\over{{c \left({x}\right)}-{p \ {{z}^{2}}}}}\right)}\over{2 \ {\sqrt{p}}\ {\sqrt{c \left({x}\right)}}}(41)
Type: Expression(Integer)
fricas
xpr13b := (wpcx/p)*(2/(1-exp(-2*wpcx*x)/wpcx)-1)

\label{eq42}{-{{\sqrt{p}}\ {\sqrt{c \left({x}\right)}}\ {{e}^{-{2 \  x \ {\sqrt{p}}\ {\sqrt{c \left({x}\right)}}}}}}-{p \ {c \left({x}\right)}}}\over{{p \ {{e}^{-{2 \  x \ {\sqrt{p}}\ {\sqrt{c \left({x}\right)}}}}}}-{p \ {\sqrt{p}}\ {\sqrt{c \left({x}\right)}}}}(42)
Type: Expression(Integer)
fricas
xpr13c := D(xpr13b,x)

\label{eq43}{\left(
\begin{array}{@{}l}
\displaystyle
-{{\sqrt{p}}\ {{c_{\ }^{,}}\left({x}\right)}\ {{{e}^{-{2 \  x \ {\sqrt{p}}\ {\sqrt{c \left({x}\right)}}}}}^{2}}}+ 
\
\
\displaystyle
{{\left({
\begin{array}{@{}l}
\displaystyle
{{\left({
\begin{array}{@{}l}
\displaystyle
- 
\
\
\displaystyle
{2 \  p \ {\sqrt{c \left({x}\right)}}}- 
\
\
\displaystyle
{4 \  p \  x \ {c \left({x}\right)}\ {\sqrt{p}}}
(43)
Type: Expression(Integer)
fricas
xpr13d := c(x) - p*(xpr13b)^2

\label{eq44}-{{4 \ {c \left({x}\right)}\ {\sqrt{p}}\ {\sqrt{c \left({x}\right)}}\ {{e}^{-{2 \  x \ {\sqrt{p}}\ {\sqrt{c \left({x}\right)}}}}}}\over{{{{e}^{-{2 \  x \ {\sqrt{p}}\ {\sqrt{c \left({x}\right)}}}}}^{2}}-{2 \ {\sqrt{p}}\ {\sqrt{c \left({x}\right)}}\ {{e}^{-{2 \  x \ {\sqrt{p}}\ {\sqrt{c \left({x}\right)}}}}}}+{p \ {c \left({x}\right)}}}}(44)
Type: Expression(Integer)
fricas
simplify(xpr13d / xpr13c)

\label{eq45}{\left(
\begin{array}{@{}l}
\displaystyle
{8 \ {{p}^{2}}\ {{c \left({x}\right)}^{3}}\ {\sqrt{p}}\ {{e}^{-{2 \  x \ {\sqrt{p}}\ {\sqrt{c \left({x}\right)}}}}}}- 
\
\
\displaystyle
{{16}\ {{p}^{2}}\ {{c \left({x}\right)}^{2}}\ {\sqrt{c \left({x}\right)}}\ {{e}^{-{4 \  x \ {\sqrt{p}}\ {\sqrt{c \left({x}\right)}}}}}}+ 
\
\
\displaystyle
{8 \  p \ {{c \left({x}\right)}^{2}}\ {\sqrt{p}}\ {{e}^{-{6 \  x \ {\sqrt{p}}\ {\sqrt{c \left({x}\right)}}}}}}
(45)
Type: Expression(Integer)
fricas
xpr13e := simplify(D((2/(1-exp(-2*wpcx*x)/wpcx)-1),x))

\label{eq46}{\left({\left({
\begin{array}{@{}l}
\displaystyle
{{\left({2 \  p \  x \ {\sqrt{c \left({x}\right)}}}+{\sqrt{p}}\right)}\ {{c_{\ }^{,}}\left({x}\right)}}+ 
\
\
\displaystyle
{4 \  p \ {c \left({x}\right)}\ {\sqrt{c \left({x}\right)}}}
(46)
Type: Expression(Integer)
fricas
xpr13f := (wpcx-exp(-2*wpcx*x))^2

\label{eq47}{{{e}^{-{2 \  x \ {\sqrt{p}}\ {\sqrt{c \left({x}\right)}}}}}^{2}}-{2 \ {\sqrt{p}}\ {\sqrt{c \left({x}\right)}}\ {{e}^{-{2 \  x \ {\sqrt{p}}\ {\sqrt{c \left({x}\right)}}}}}}+{p \ {c \left({x}\right)}}(47)
Type: Expression(Integer)
fricas
xpr13g := simplify(((2*p*c(x)*x+wpcx)*D(c(x),x)+4*p*c(x)^2)/wpcx)

\label{eq48}{{{\left({{\sqrt{p}}\ {\sqrt{c \left({x}\right)}}}+{2 \  p \  x \ {c \left({x}\right)}}\right)}\ {{c_{\ }^{,}}\left({x}\right)}}+{4 \  p \ {{c \left({x}\right)}^{2}}}}\over{{\sqrt{p}}\ {\sqrt{c \left({x}\right)}}}(48)
Type: Expression(Integer)
fricas
xpr13h := simplify((1+2*wpcx*x)*D(c(x),x)+4*wpcx*c(x))

\label{eq49}{{\left({2 \  x \ {\sqrt{p}}\ {\sqrt{c \left({x}\right)}}}+ 1 \right)}\ {{c_{\ }^{,}}\left({x}\right)}}+{4 \ {c \left({x}\right)}\ {\sqrt{p}}\ {\sqrt{c \left({x}\right)}}}(49)
Type: Expression(Integer)
fricas
simplify(xpr13h/xpr13g)

\label{eq50}1(50)
Type: Expression(Integer)
fricas
xpr13i := simplify((1/(wpcx-z)-1/(2*wpcx))*D(c(x),x) + ((1+2*wpcx*x)*D(c(x),x)+4*wpcx*c(x))*z/(wpcx-z)^2)

\label{eq51}{\left(
\begin{array}{@{}l}
\displaystyle
{{\left({
\begin{array}{@{}l}
\displaystyle
{{\left({{\left(-{4 \  p \  x \  z}- p \right)}\ {c \left({x}\right)}}+{3 \ {{z}^{2}}}\right)}\ {\sqrt{p}}\ {\sqrt{c \left({x}\right)}}}+ 
\
\
\displaystyle
{{\left({4 \  p \  x \ {{z}^{2}}}-{p \  z}\right)}\ {c \left({x}\right)}}-{{z}^{3}}
(51)
Type: Expression(Integer)
fricas
w := operator w

\label{eq52}w(52)
fricas
z := operator z

\label{eq53}z(53)
fricas
simplify(D((2/(1-z(x)/w(x))-1)*c(x)/w(x),x))

\label{eq54}{\left(
\begin{array}{@{}l}
\displaystyle
{2 \ {c \left({x}\right)}\ {{w \left({x}\right)}^{2}}\ {{z_{\ }^{,}}\left({x}\right)}}+ 
\
\
\displaystyle
{{\left({{c \left({x}\right)}\ {{z \left({x}\right)}^{2}}}-{2 \ {c \left({x}\right)}\ {w \left({x}\right)}\ {z \left({x}\right)}}-{{c \left({x}\right)}\ {{w \left({x}\right)}^{2}}}\right)}\ {{w_{\ }^{,}}\left({x}\right)}}+ 
\
\
\displaystyle
{{\left(-{{w \left({x}\right)}\ {{z \left({x}\right)}^{2}}}+{{w \left({x}\right)}^{3}}\right)}\ {{c_{\ }^{,}}\left({x}\right)}}
(54)
Type: Expression(Integer)
fricas
simplify((2*c(x)*w(x)^2*D(z(x),x)+(z(x)^2-2*w(x)*z(x)-w(x)^2)*c(x)*D(w(x),x)+(w(x)^3-w(x)*z(x)^2)*D(c(x),x))/(w(x)^2*(z(x)-w(x))^2))

\label{eq55}{\left(
\begin{array}{@{}l}
\displaystyle
{2 \ {c \left({x}\right)}\ {{w \left({x}\right)}^{2}}\ {{z_{\ }^{,}}\left({x}\right)}}+ 
\
\
\displaystyle
{{\left({{c \left({x}\right)}\ {{z \left({x}\right)}^{2}}}-{2 \ {c \left({x}\right)}\ {w \left({x}\right)}\ {z \left({x}\right)}}-{{c \left({x}\right)}\ {{w \left({x}\right)}^{2}}}\right)}\ {{w_{\ }^{,}}\left({x}\right)}}+ 
\
\
\displaystyle
{{\left(-{{w \left({x}\right)}\ {{z \left({x}\right)}^{2}}}+{{w \left({x}\right)}^{3}}\right)}\ {{c_{\ }^{,}}\left({x}\right)}}
(55)
Type: Expression(Integer)
fricas
xpr13j := simplify((2*c(x)*w(x)^2*w(x)*z(x)*(x/c(x)-1/2)+(z(x)^2-2*w(x)*z(x)-w(x)^2)*c(x)*(-w(x)/(2*c(x)))+(w(x)^3-w(x)*z(x)^2)*D(c(x),x))/(w(x)^2*(z(x)-w(x))^2))

\label{eq56}{\left(
\begin{array}{@{}l}
\displaystyle
{{\left(-{2 \ {{z \left({x}\right)}^{2}}}+{2 \ {{w \left({x}\right)}^{2}}}\right)}\ {{c_{\ }^{,}}\left({x}\right)}}-{{z \left({x}\right)}^{2}}+ 
\
\
\displaystyle
{{\left({{\left(-{2 \ {c \left({x}\right)}}+{4 \  x}\right)}\ {{w \left({x}\right)}^{2}}}+{2 \ {w \left({x}\right)}}\right)}\ {z \left({x}\right)}}+{{w \left({x}\right)}^{2}}
(56)
Type: Expression(Integer)
fricas
xpr13k := simplify((1/(w(x)-z(x))-1/(2*w(x)))*D(c(x),x) + ((1+2*w(x)*x)*D(c(x),x) + 4*w(x)*c(x))*z(x)/(w(x)-z(x))^2)

\label{eq57}{\left(
\begin{array}{@{}l}
\displaystyle
{{\left({
\begin{array}{@{}l}
\displaystyle
-{{z \left({x}\right)}^{2}}+{{\left({4 \  x \ {{w \left({x}\right)}^{2}}}+{2 \ {w \left({x}\right)}}\right)}\ {z \left({x}\right)}}+ 
\
\
\displaystyle
{{w \left({x}\right)}^{2}}
(57)
Type: Expression(Integer)
fricas
simplify(xpr13k/xpr13j)

\label{eq58}{\left(
\begin{array}{@{}l}
\displaystyle
{{\left({
\begin{array}{@{}l}
\displaystyle
{{z \left({x}\right)}^{2}}+{{\left(-{4 \  x \ {{w \left({x}\right)}^{2}}}-{2 \ {w \left({x}\right)}}\right)}\ {z \left({x}\right)}}- 
\
\
\displaystyle
{{w \left({x}\right)}^{2}}
(58)
Type: Expression(Integer)
fricas
simplify(xpr13k-xpr13j)

\label{eq59}{\left(
\begin{array}{@{}l}
\displaystyle
{{\left({{z \left({x}\right)}^{2}}+{{\left({4 \  x \ {{w \left({x}\right)}^{2}}}+{2 \ {w \left({x}\right)}}\right)}\ {z \left({x}\right)}}-{{w \left({x}\right)}^{2}}\right)}\ {{c_{\ }^{,}}\left({x}\right)}}+ 
\
\
\displaystyle
{{z \left({x}\right)}^{2}}+{{\left({{\left({{10}\ {c \left({x}\right)}}-{4 \  x}\right)}\ {{w \left({x}\right)}^{2}}}-{2 \ {w \left({x}\right)}}\right)}\ {z \left({x}\right)}}- 
\
\
\displaystyle
{{w \left({x}\right)}^{2}}
(59)
Type: Expression(Integer)




  Subject:   Be Bold !!
  ( 13 subscribers )  
Please rate this page: