1
$\begingroup$

I am a new user of Mathematica, and I am trying to figure out how to solve the following integro-differential equation in Mathematica:

$\frac{\partial c(x,t)}{\partial t} = -2 \mu x c(x,t) + 4 \mu \int_{x}^{\infty} c(s,t) \mathrm{d} s $,

where $\mu$ is a constant.

By setting the initial condition as $c(x,0)=\delta(N-x)$, where $\delta(x)=1$ if $x=N$, and $\delta(x)=0$ otherwise (Kronecker delta function), the expected solution is given by:

$c(x,t) = [4 \mu t + 4 \mu^2 t^2 (N-x)] e^{-2 \mu x t}$

when $0<x<N$. If $x=N$, $c(x,t) = e^{-2 \mu N t}$. For $x \leq 0$ or $x > N$, $c(x,t)=0$.

I tried the following in Mathematica:

pdeeq = D[c[x,t], t] == -2*m*x*c[x,t] + 4*m*Integrate[c[s,t], {s, x, N}]
soleq = DSolveValue[{pdeeq,c[x, 0] == KroneckerDelta[x, N]}, c[x,t], {x,t}]

However, instead of the expected solution indicated above, I get:

enter image description here

Am I missing something? Why the output from Mathematica does not match the expected output?

$\endgroup$
3
  • $\begingroup$ Differentiating your equation gives a pde: D[-D[c[x, t], t] - 2*m*x*c[x, t] + 4*m*Integrate[c[s, t], {s, x, N}], x] $-2 m x c^{(1,0)}(x,t)-c^{(1,1)}(x,t)-6 m c(x,t)=0$ $\endgroup$ Commented Nov 2, 2023 at 15:56
  • 1
    $\begingroup$ Are you sure that the initial condition shouldn't be a Dirac delta function instead of a Kronecker delta? $\endgroup$
    – march
    Commented Nov 2, 2023 at 16:45
  • $\begingroup$ It's best practice not to use N as a variable in Mathematica, since N is the function that converts symbolic values into numerical ones (e.g. N[Pi] = 3.1415926...) $\endgroup$ Commented Nov 2, 2023 at 18:45

2 Answers 2

2
$\begingroup$

Your equation is separable and can be solved analitically. If you define

$$c(x,t)=c_1(x)c_2(t)$$

and substitute back into your equation, you see you obtain the two equations:

$$c_2^\prime(t)=L\,c_2(t)$$

$$L\,c_1(x)=-2m x c_1(x)+4m\, \int_x^N c_1(s) ds$$

The first is trivial, the second can be solved with a further derivation in $x$, and also becomes trivial.

The separation constant is obtained from your boundary conditions.

$\endgroup$
1
  • $\begingroup$ For the second, you could also define $\int_x^N c_1 ds = C(x)$ and $c_1(x)=-C^\prime(x)$, solve for $C$ and finally take the derivative of the result. $\endgroup$
    – mattiav27
    Commented Nov 2, 2023 at 16:21
1
$\begingroup$

Mathematica can't solve your integral equation, DSolve only returns a simplified form I think:

pdeeq = D[c[x,t], t] == -2*m*x*c[x,t] + 4*m*Integrate[c[s,t], {s, x, N}]
soleq = DSolve [{pdeeq,c[x, 0] == KroneckerDelta[x, N]}, c[x,t], {x,t}]

$c(x,t)=e^{-2 m t x} \left(-\int _1^t-4 e^{2 m x K[1]} m \int_x^N c(s,K[1]) \, dsdK[1]+\int _1^0-4 e^{2 m x K[1]} m \int_x^N \delta _{N,s} \, dsdK[1]+\delta _{N,x}\right)$

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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