# Dsolve 1D Maxwell Equations for time varying medium

I'm trying to solve a toy model of 1D maxwell equations for a time-varying medium. In this case the permittivity varies as $(1+t)^2$.

My PDE-systems looks like this

$$\frac{\partial}{\partial t}(U(x,t)(1+t)^2)=\frac{\partial}{\partial x}V(x,t)\\ \frac{\partial}{\partial t}V(x,t)=\frac{\partial}{\partial x}U(x,t)$$

with initial conditions

$$U(x,0)=\sin(x)\\V(x,0)=-\cos(x)/2$$

The exact solution on the spatial interval $[0,\pi]$ is

$$U(t,x)=\frac{1}{\sqrt{(1+t)^3}}\cos(\frac{\sqrt{3}\ln(1+t)}{2})\sin(x)$$ $$V(t,x)=\frac{1}{2\sqrt{1+t}}\left(-\cos(\frac{\sqrt{3}\ln(1+t)}{2})+\sqrt{3}\sin(\frac{\sqrt{3}\ln(1+t)}{2})\right)\cos(x)$$

Can Mathematica's Dsolve find this solution? I've tried to,but I failed. What am I doing wrong? Here's my attempt:

ClearAll[U, V]
sys = {
D[U[x, t], t] == (D[V[x, t], x] - 2*(1 + t)*U[x, t])/(1 + t)^2,
D[V[x, t], t] == D[U[x, t], x],
U[x, 0] == Sin[x],
V[x, 0] == -Cos[x]/2}
DSolve[sys, {U[x, t], V[x, t]}, {x, t}]


EDIT: first equation was wrong. Still I cant find a solution using Dsolve

• The solution you give doesn't seem to satisfy your first equation: Simplify[sys[[1]] /. {U -> Function[{x, t}, 1/Sqrt[(1 + t)^3] Cos[(Sqrt[3] Log[1 + t])/2] Sin[x]], V -> Function[{x, t}, 1/(2 Sqrt[(1 + t)]) (-Cos[(Sqrt[3] Log[1 + t])/2] + Sqrt[3] Sin[(Sqrt[3] Log[1 + t])/2]) Cos[x]]}, {t > 0, x > 0}] gives Cos[1/2 Sqrt[3] Log[1 + t]] Sin[x] == 0 – KraZug May 16 '18 at 13:38
• DSolve[]'s support for PDE equations is still somewhat limited, so don't be surprised if some things don't work yet. In yours case Maple 2018 finds only general solution. Comparison Maple vs MMA:12000.org/my_notes/pde_in_CAS/pde_in_cas.htm – Mariusz Iwaniuk May 16 '18 at 13:50
• Thanks KraZug for your hint. @Mariusz Iwaniuk: Have you checked it with Maple using the corrections? Because I was thinking about trying Maple. I was told it's more flexible than Mathematica. – OD IUM May 16 '18 at 13:52
• With yours corrections Maple finds only general solution. Better is use MMA+Maple then You have the Force !!! – Mariusz Iwaniuk May 16 '18 at 15:28
• Ok. So obviously no software is able to give me a closed form solution for this. However, I'm pretty sure I could get quite close using the power series solution method, which Mathematica/Maple and even Matlab should be able to handle. Do you know if there's a built-in method in any of these ? – OD IUM May 16 '18 at 20:39