kill(all)$

calculus :Volterra Integral Eqn and ODE,version 1.0
peter.vlasschaert@gmail.com,10/06/2020

load   packages
============

load(lrats)$
load(contrib_ode)$

Conversion : Volterra Integral Equation into Initial Value Problem:
==================================================
notation :  VIE  → IVP (ode)

rem : ode : (o)rdinary (d)ifferential (e)quation

load(inteqn);

contains: load , 'intexs.mac'
"C:/maxima-5.43.2/share/maxima/5.43.2/share/integequations/intexs.mac"

eq[0]:sqrt((1+x)*exp(-10*x)+1)+(1+x)*(1-exp(-10*x))+10*log(1+x)-
	10*'integrate((1+x)*p(u)^2/(1+u),u,0,x)-p(x)$
eq[1]:p(x)-x-'integrate(p(u)*sum((x*u)^i,i,0,5),u,0,1)$
eq[2]:p(x)-x-'integrate((1+x)*(p(u)*u^2+p(u)^2*u+p(u)^3),u,0,1)$
eq[3]:1/sqrt(1+x)+%pi/8-1/4*asin((1-x)/(1+x))-'integrate(p(u)/sqrt(x-u),u,0,x)-p(x)$
eq[4]:'integrate(p(u)/sqrt(x-u),u,0,x)-x$
eq[5]:p(x)-'integrate(x*u*p(u),u,0,x)-exp(-x)*(1+x+x^2)+x$
eq[6]:p(x)-'integrate(x*u*p(u),u,0,x)-sin(%pi*x)*(1-x/%pi^2)-x^2*cos(%pi*x)/%pi$
eq[7]:p(x)-3-2*x+'integrate(p(u)*(2*(x-u)+3),u,0,x)$
eq[8]:p(x)-2*x^(3/2)/3-'integrate(sqrt(p(u)),u,0,x)$
eq[9]:p(x)-exp(-x)*(1-exp(-b*x)-a*'integrate(p(u)/sqrt(%pi*(x-u)),u,0,x))$
eq[10]:'integrate((u^2+3*u*(u-x)-(u-x)^2)*p(u),u,0,x)$
eq[11]:'integrate(p(u)/sqrt(1+p(x)-p(u)),u,0,x)-x^2$
eq[12]:p(x)-'integrate(sin(x)*cos(u)*p(u),u,0,x)-sin(x)-(1-sin(x))*exp(sin(x))$
eq[13]:p(x)-sin(x)/2-1/2*'integrate(p(u)*p(x-u),u,0,x)$
eq[14]:p(x)-'integrate(p(u)*u^(x-1),u,0,x)$
eq[15]:p(x)-1-'integrate(exp(a*(x-u))*p(u),u,0,x)$
eq[16]:p(x)-'integrate(p(u)^a,u,0,x)$
eq[17]:p(x)-1+'integrate(p(u)/sqrt(x-u),u,0,x)$
eq[18]:p(x)-'integrate((1-p(u)^4)/sqrt(x-u),u,0,x)$
eq[19]:p(x)-'integrate(u^(x-u)*p(u),u,0,x)$
eq[20]:p(x)-'integrate(sqrt(x^2-u^2)*p(u),u,0,x)$
eq[21]:k*p(x)^(2/3)-u*x+'integrate(((x-u)/m+r(x-u))*p(u),u,0,x)$
eq[23]:p(x)+1+'integrate((x-u)*sqrt(p(u)),u,0,x)$
eq[24]:p(x)+1/r*'integrate((p(u)-c*sin(u))^3/sqrt(x-u),u,0,x)$
eq[25]:p(x)-k-'integrate(p(u)^2/sqrt(x-u),u,0,x)$
eq[26]:'integrate(exp(-l*p(u)*x),u,0,1)-exp(-k*x)$
eq[27]:'integrate(p(u)*(x-u)^2,u,0,1)-x^2/2+2*x/3-1/4$
eq[28]:p(x)-'integrate(x*u*p(u)^2,u  ,0,1)-3*x/4$
eq[29]:p(x)-'integrate(exp(x*u-p(u)^2),u,0,1)-sqrt(x)+
   (exp(x-1)-1)/(x-1)$
eq[30]:p(x)-1+w/2*'integrate(x/p(u)/(x+u),u,0,1)$
eq[31]:p(x)-'integrate((x+u)*p(u)^2,u,0,1)$
eq[32]:p(x)-a-%l*'integrate(p(u)^2,u,0,1)$
eq[33]:p(x)-10*'integrate(exp(x*u)*p(u),u,0,1)+x-10/x^2*((x-1)*exp(x)+1)$
eq[34]:p(x)-1/2*'integrate(p(u)*exp(x-u),u,0,1)$
eq[35]:p(x)='integrate(log(abs(cos(x)-cos(u)))*p(u),u,0,1)-1$
eq[36]:p(x)+7*x/3+3/2-'integrate((x-u)*p(u)^2,u,0,1)$
eq[37]:p(x)-'integrate((x*sin(%pi*u)+cos(%pi*u))*p(u),u,0,1)$
eq[38]:p(x)-x-%l*'integrate((x*u+sqrt(x*u))*p(u),u,0,1)$
eq[39]:p(x)-%l*'integrate(p(u)^2*(x-u),u,0,1)$
eq[40]:p(x)-%l*'integrate(sin(p(u))*(x^2+u^2),u,0,1)$
eq[41]:p(x)-%l*'integrate((x^2+u^2)/(1+abs(p(u))),u,0,1)$
eq[42]:p(x)-2/%pi*'integrate(sin(x)*p(u)^2,u,0,%pi)$
eq[43]:p(x)-1-w*x*p(x)/2*'integrate(p(u)/(x+u),u,0,1)$

?? ieqn;

parameter : function 
================

p1:x^3/6-x+1;

p2:(sin(u)-(x-u)*(exp(u)+cos(u)))*p(u);

Integral equations , p(x)
==================

pa:p(x) = p1+'integrate(p2,u,0,x);

conversion : integral equation → corresponding differential equation
====================================================

p3:ieqn(p(x)-p1-'integrate(p2,u,0,x),p(x));

result
====

p4:p3;

p4a:p4[1];

→ differential equation

p4b1:p4a[1]=0;

p4b1a:factor(p4b1);

p4b1b:lhs(p4b1a)/part(lhs(p4b1a),1) = rhs(p4b1a);

p4b1c:p4b1b+x;

→ Ic =( i)nitial (c)onditions 

p4b2:p4a[3];

→ variables

p4c:listofvars(p4b1);

p4d:subst([p(x)=y(x)],p4b1c);

rem :ic 'see  : p4b2'
===============

laplace(diff(p(x),x,2),x,s);
laplace(diff(p(x),x,1),x,s);

how to find : IVP → VIE
==================

p5a:p4d;

p5b:subst([p(x)=y(x)],p4b2);

assume(z>0);

p5c1:at(p5b[3], x=0);
p5c2:at(p5b[2],x=0);

p5d:diff(y(x),x,n);

a) integration : differential,diff(y(x),x,n), n = integer
=======================================

myintegrate(qq,a1,b1,xx):=block([],
q1:integrate(qq,xx),
q2:lratsubst([y(x)=y(b1)],q1) -lratsubst([y(x)=y(a1)],q1)   
)$

grind(myintegrate)$

p5e:myintegrate(diff(y(x),x,3),0,z,x);

b) partial integration
================

p5f:integrate(part(lhs(p4d),2),x,0,z);

p5f1:args(p5f);

p5f2:args(p5f1[1]);

p5f3a:part(p5f2[1],1);
p5f3b:part(p5f2[1],2);

see :Maxima by Example ,Edwin L.Woollett,aug 2009

b1) integration : an indefinite integral.
--------------------------------------------------

iparts(f,h,var):=block([g],
    g:integrate(h,var),
    f*g-'integrate(g*diff(f,var),var)
);

p6:iparts(p5f3a,p5f3b,p5f2[2]);

b2) integration : an definite integral.
------------------------------------------------

idefparts(f,h,var,v1,v2):=block([g],
    g:integrate(h,var),
    /*'lratsubst([var=v2],f*g)-'lratsubst([var=v1],f*g)    */
    /* need extra evalution :  ev(%,nouns) ,see %i81   */
    lratsubst([var=v2],f*g)-lratsubst([var=v1],f*g)
    - 'integrate(g*diff(f,var),var,v1,v2)
)$

optimized: code (display)
====================

grind(idefparts)$

z1:lower limit of integration
z2:Upper limit of integration

p6a:idefparts(p5f3a,p5f3b,p5f2[2],z1,z2);

p6b:ev(%,nouns);

p6c:idefparts(p5f3a,p5f3b,p5f2[2],0,x);

c) double integral ,triple integral → single integral
======================================

my website :  'calculus: (important topics)'

3e)Integration by parts Calculus.

new: 12/08/2019:Calculus : integration by parts ,version 1.0 (functions: PI)
download  (Maxima,code)       :calculusintegrationbypartsversion1final
download  (Maxima,png)         :calculusintegrationbypartsversion1finaloutp

4e)double integral to a single integral.

rem : BVP ( = Boundary Value Problem)  to a  IE (= Integral Equation)
new: 21/08/2019:Calculus : double integral to a single integral ,version 1.0
download  (Maxima,code)       :calculusdoubleintegraltosingleintegralintegraleqversion1final
download  (Maxima,png)         :calculusdoubleintegraltosingleintegralintegraleqversion1finaloutp

5e)triple integral to a single integral.

new: 22/08/2019:Calculus : triple integral to a single integral ,version 1.0
download  (Maxima,code)       :calculusdoubleintegraltosingleintegralintegraleqversion1finalextra
download  (Maxima,png)         :calculusdoubleintegraltosingleintegralintegraleqversion1finalextraout

process:
=======

→ first step :find highst derivativ, p5a  (see above)
=======================================

p8:p5a;

p8a:solve(p8,'diff(y(x),x,2))[1];

p8a1:part(rhs(p8a),1);

p8a2:part(rhs(p8a),2);

p8a3:part(rhs(p8a),3);

→ second step :first integration
=======================================
use : lhs → myintegrate
use : rhs  →integrate

assume(x>0);

p8b:myintegrate(lhs(p8a),0,x,x)=expand(integrate(rhs(p8a),x,0,x));

integrate(rhs(p8a),x);

p8c:makelist(part(rhs(p8a),kk),kk,1,3);

p8d:integrate(p8c,x,0,x);

use :p6c: PI = Partial Integration

p8d1:lratsubst([p8d[1]=p6c],p8d);

p8e:lhs(p8b) =sum(p8d1[kk],kk,1,length(p8d1));

use : IC condition ,(see above),p5b,{p5c1,p5c2}

p8e1:lratsubst(['diff(y(0),x,1)=rhs(p5c1)],p8e);

p8e2:solve(p8e1,'diff(y(x),x,1))[1],expand;

p8e3:lhs(p8e2) = factorsum(rhs(p8e2));

→ third step :second integration
=======================================

p8f:args(rhs(p8e2));

p8fa:args(p8f[1]);

p8fa1:args(p8fa[1])[1];

p8fb:args(p8f[2]);
p8fb1:args(p8fb[1])[1];

1e)  integration: rhs(p8e3)
------------------------------------

p8f1:integrate(p8f,x,0,x);

2e)  integration: lhs(p8e3)
------------------------------------

p8f2:myintegrate(lhs(p8e3),0,x,x);

use :use : IC condition ,(see above),p5b,{p5c1,p5c2}

p8f2a:lratsubst([p5c2],p8f2);

3e)  combine : lhs=rhs
--------------------------------

p8f3: p8f2a=sum(p8f1[kk],kk,1,length(p8f1));

4e)  solve :y(x)
----------------------

p8f4:p8f3+1;

→ fourth step :remove ' double and triple integrals'
=======================================
use: see website also 'see above'
----------------------------------------------------------------------
c) double integral ,triple integral → single integral
======================================

use :p8f1

p8g:p8f1;

list 'p8g' :above :[double integral,double integral,integral,function,function]

FORMULA
---------------

p8g1:'integrate(u(z),z^n,a,x)='integrate('(x-z)^(n-1)/(n-1)!*u(z),z,a,x);

example : n=2;double integral
                  n=3: triple integral

p8g2:subst([n=2],p8g1);

list :u(z) ,needed n=2,n=3....

p8g3a:[u(z)=subst([x=z],p8fa1),u(z)=subst([x=z],p8fb1)];

1e) double integral:list'p8g'

p8g3a1:subst([p8g3a[1],a=0],p8g2);

2e) double integral:list'p8g'

p8g3b1:subst([p8g3a[2],a=0],p8g2);

→ fifth step :final result
=======================================

a)  mono integral 
------------------------
use :p8f

p8h:subst([x=z],p8f[3]);

p8h1:integrate(p8h,z,0,x);

b) new list:rhs
-------------------
old list :p8g

p8ha:p8g;

p8ha1:p8ha[1];

p8ha2:part(p8ha1,0);

p8ha3:makelist(part(p8ha[kk],0),kk,1,length(p8ha));

p8ha4:[rhs(p8ha3[1]*p8g3a1),rhs(p8ha3[2]*p8g3b1),p8h1,p8ha[4],p8ha[5]];

c) final result
------------------

p8ha5:lhs(p8f3)=sum(p8ha4[kk],kk,1,length(p8ha4));

p8ha6:p8ha5+1;

result : Volterra Integral Equation of the second kind.

 ==============================================================================