0
$\begingroup$

Please I am struggling to compute with mathematica the first 5th iterations of the sequence of functions $u[n,t]$ satisfying the integro-differential equation enter image description here

Please help me with the code.

Patrick

$\endgroup$
  • $\begingroup$ u0[x_] := -x/6 + 2/3; u1[x_] := u0[x] + Integrate[(t-1) (2-x) (u0''[t] - u0[t]^3 + u0[t] u0'[t]), {t, 1, x}] + Integrate[(x-1) (2-t) (u0''[t] - u0[t]^3 + u0[t] u0'[t]), {t, x, 2}]; u1[x] shows me u1. Then u2[x_] := u1[x] + Integrate[(t-1) (2-x) (u1''[t] - u1[t]^3 + u1[t] u1'[t]), {t, 1, x}] + Integrate[(x - 1) (2 - t) (u1''[t] - u1[t]^3 + u1[t] u1'[t]), {t, x, 2}]; u2[x] shows me u2. Repeat for u3, u4, ... $\endgroup$ – Bill Jul 12 '18 at 14:43
  • 1
    $\begingroup$ @Bill if that is an answer, why don't you post it as such? $\endgroup$ – rhermans Jul 12 '18 at 14:51
  • $\begingroup$ @Patrick Here its considered helpful to show your own efforts and share your code in a well formatted form instead of images or links to external files, so we can quickly Copy&Paste your code, test it, and see the problem you are facing. Please help us to help you and edit your question accordingly. This question in Meta could be useful. $\endgroup$ – rhermans Jul 12 '18 at 14:51
2
$\begingroup$

Perhaps little bit more comfortable than Bill's answer:

igl[x_, u_(* function*)] :=u[x] + 
Integrate[(t - 1) (2 - x) (u''[t] - u[t]^3 + u[t] u'[t]), {t,1, x}] +
Integrate[(x - 1) (2 - t) (u''[t] - u[t]^3 + u[t] u'[t]), {t, x, 2}]
u0[x_] := -x/6 + 2/3
u1[x_] :=igl[x,u0 ]  
u2[x_] :=igl[x,u1]  
(* ... *)

A much nicer program could be somthing like

NestList[Evaluate[igl[x, #&]]  , u0 , 1]

but it doesn't run...

$\endgroup$
  • $\begingroup$ How about something along the lines of u[0][x_]:=-x/6 + 2/3 and u[n_][x_]:=igl[x,u[n-1]] (untested)? $\endgroup$ – AccidentalFourierTransform Jul 12 '18 at 15:37
  • $\begingroup$ @AccidentalFourierTransform: It works, thank you! But I'm still wondering why NestList[ igl[x, # & ] , -x/6 + 2/3 , 1] doesn't work. $\endgroup$ – Ulrich Neumann Jul 12 '18 at 15:44
  • $\begingroup$ Thank you very much guys for your help. It is working :) $\endgroup$ – Patrick Jul 12 '18 at 21:30

Not the answer you're looking for? Browse other questions tagged or ask your own question.