#### 5.1.3 Inﬁnite domain

##### 5.1.3.1 [377] General case. $$u_{tt} = u_{xx}$$ with $$u(x,0)=f(x),u_t(x,0)=g(x)$$

problem number 377

Solve for $$u(x,t)$$ for all $$x$$ and $$t>0$$ with $$u(x,0)=f(x)$$ and $$u_t(x,0)=g(x)$$ \begin {align*} u_{tt} = u_{xx} \end {align*}

Mathematica

$\left \{\left \{u(x,t)\to \begin {array}{cc} \{ & \begin {array}{cc} \frac {1}{2} (f(x-t)+f(t+x))+\frac {1}{2} \int _{x-t}^{t+x}g(K[1])dK[1] & t\geq 0 \\ \text {Indeterminate} & \text {True} \\\end {array} \\\end {array}\right \}\right \}$

Maple

$u \left (x , t\right ) = \frac {\left (\int _{-t +x}^{t +x}g \left (\mathit {x1} \right )d \mathit {x1} \right )}{2}+\frac {f \left (-t +x \right )}{2}+\frac {f \left (t +x \right )}{2}$

________________________________________________________________________________________

##### 5.1.3.2 [378] General case. No IC given. $$u_{tt} + u_{xt} = c^2 u_{xx}$$

problem number 378

From Mathematica DSolve help pages (slightly modiﬁed)

Solve for $$u(x,t)$$ with $$t>0$$ on real line $u_{tt} + u_{xt} = c^2 u_{xx}$

Mathematica

$\left \{\left \{u(x,t)\to c_1\left (t-\frac {\left (\sqrt {4 c^2+1}-1\right ) x}{2 c^2}\right )+c_2\left (\frac {2 c^2 t+\sqrt {4 c^2+1} x+x}{2 c^2}\right )\right \}\right \}$

Maple

$u \left (x , t\right ) = \mathit {\_F1} \left (\frac {2 c^{2} t +\sqrt {4 c^{2}+1}\, x +x}{2 c^{2}}\right )+\mathit {\_F2} \left (\frac {2 c^{2} t -\sqrt {4 c^{2}+1}\, x +x}{2 c^{2}}\right )$

________________________________________________________________________________________

##### 5.1.3.3 [379] $$u_{tt}= c^2 u_{xx} + f(x,t)$$, IC at $$t=1$$,$$u(x,1) = g(x),u_t(x,1)=h(x)$$

problem number 379

Solve $u_{tt}= c^2 u_{xx} + f(x,t)$ With initial conditions not at zero \begin {align*} u(x,1) &= g(x)\\ \frac {\partial u}{\partial t}(x,1) &= h(x) \end {align*}

Mathematica

$\left \{\left \{u(x,t)\to \begin {array}{cc} \{ & \begin {array}{cc} \frac {1}{2} \left (g\left (x-\sqrt {c^2} (t-1)\right )+g\left (\sqrt {c^2} (t-1)+x\right )\right )+\frac {\int _{x-\sqrt {c^2} (t-1)}^{\sqrt {c^2} (t-1)+x}h(K[1])dK[1]}{2 \sqrt {c^2}} & t-1\geq 0 \\ \text {Indeterminate} & \text {True} \\\end {array} \\\end {array}\right \}\right \}$

Maple

$u \left (x , t\right ) = \frac {2 c g (x )+\left (2 t -2\right ) c h (x )+\int _{0}^{t -1}\int _{\left (-t +\tau +1\right ) c +x}^{\left (t -\tau -1\right ) c +x}\left (c^{2} \tau \left (\frac {d^{2}}{d \zeta ^{2}}h \left (\zeta \right )\right )+c^{2} \left (\frac {d^{2}}{d \zeta ^{2}}g \left (\zeta \right )\right )+f \left (\zeta , \tau +1\right )\right )d \zeta d \tau }{2 c}$

________________________________________________________________________________________

##### 5.1.3.4 [380] No source. $$u_{tt} = u_{xx}$$, with $$u(x,0) =e^{-x^2},u_t(x,0)=1$$

problem number 380

Taken from Mathematica DSolve help pages.

Solve initial value wave PDE on inﬁnite domain $u_{tt} = u_{xx}$ With initial conditions \begin {align*} u(x,0) &=e^{-x^2} \\ \frac {\partial u}{\partial t}(x,0) &= 1 \end {align*}

Mathematica

$\left \{\left \{u(x,t)\to \begin {array}{cc} \{ & \begin {array}{cc} \frac {1}{2} \left (e^{-(x-t)^2}+e^{-(t+x)^2}\right )+t & t\geq 0 \\ \text {Indeterminate} & \text {True} \\\end {array} \\\end {array}\right \}\right \}$

Maple

$u \left (x , t\right ) = t +\frac {{\mathrm e}^{-\left (t -x \right )^{2}}}{2}+\frac {{\mathrm e}^{-\left (t +x \right )^{2}}}{2}$

________________________________________________________________________________________

##### 5.1.3.5 [381] With source term. $$u_{tt} = u_{xx} + m$$

problem number 381

Taken from Mathematica DSolve help pages.

Solve initial value wave PDE on inﬁnite domain $u_{tt} = u_{xx} + m$ With initial conditions \begin {align*} u(x,0) &=\sin x- \frac {\cos 3 x}{e^{ \frac {abs(x)}{6} }} \\ \frac {\partial u}{\partial t}(x,0) &= 0 \end {align*}

Mathematica

$\left \{\left \{u(x,t)\to \begin {array}{cc} \{ & \begin {array}{cc} \frac {1}{2} \left (m t^2-e^{-\frac {| t-x| }{6}} \cos (3 t-3 x)-e^{-\frac {| t+x| }{6}} \cos (3 (t+x))+2 \cos (t) \sin (x)\right ) & t\geq 0 \\ \text {Indeterminate} & \text {True} \\\end {array} \\\end {array}\right \}\right \}$

Maple

$u \left (x , t\right ) = \frac {\left (-\cos \left (3 t -3 x \right ) {\mathrm e}^{\frac {{| t +x |}}{6}}+\left (-\cos \left (3 t +3 x \right )+\left (m t^{2}-\sin \left (t -x \right )+\sin \left (t +x \right )\right ) {\mathrm e}^{\frac {{| t +x |}}{6}}\right ) {\mathrm e}^{\frac {{| t -x |}}{6}}\right ) {\mathrm e}^{-\frac {{| t -x |}}{6}} {\mathrm e}^{-\frac {{| t +x |}}{6}}}{2}$

________________________________________________________________________________________

##### 5.1.3.6 [382] non-linear (Solitons) $$u_t +6 u(x,t) u_x + u_{xxx} = 0$$

problem number 382

This was ﬁrst solved analytically by (Krvskal, Zabrsky 1965).

Solve $u_t +6 u(x,t) u_x + u_{xxx} = 0$

Mathematica

$\left \{\left \{u(x,t)\to -\frac {12 c_1{}^3 \tanh ^2(c_2 t+c_1 x+c_3)-8 c_1{}^3+c_2}{6 c_1}\right \}\right \}$

Maple

$u \left (x , t\right ) = -2 c_{2}^{2} \left (\tanh ^{2}\left (c_{3} t +c_{2} x +c_{1}\right )\right )+\frac {8 c_{2}^{3}-c_{3}}{6 c_{2}}$

Hand solution

Solve $u_{t}+6u\ u_{x}+u_{xxx}=0$ Assuming special solution $$u=f\left ( \xi \right )$$ where $$\xi =x-ct$$, this PDE is transformed to non-linear ﬁrst order ODE$-c\frac {f^{2}}{2}+f^{3}+\frac {1}{2}\left ( \frac {df}{d\xi }\right ) ^{2}=0$ The above is solved analytically (Krvskal, Zabrsky 1965) and the solution is$f\left ( x,c,t\right ) =\left ( \frac {1}{2}c\right ) \operatorname {sech}^{2}\left ( \frac {\sqrt {c}}{2}\left ( x-ct\right ) \right )$ Tall waves move fast but have smaller period, while short wave move slow. Tall wave pass through short wave and leave in same shape they entered. Here are two animations and the above solution. This ﬁrst animation has one tall wave passing though short wave

Source code used for the above

This animation shows three waves interacting

Source code used for the above

________________________________________________________________________________________

##### 5.1.3.7 [383] Inhomogeneous PDE $$3 u_{xx}- u_{tt} + u_{xt}=1$$

problem number 383

From Mathematica DSolve help pages. Inhomogeneous hyperbolic PDE with constant coeﬃcients.

Solve for $$u(x,t)$$ $3 u_{xx}- u_{tt} + u_{xt}=1$

Mathematica

$\left \{\left \{u(x,t)\to c_1\left (t-\frac {1}{6} \left (1+\sqrt {13}\right ) x\right )+c_2\left (t+\frac {1}{6} \left (\sqrt {13}-1\right ) x\right )+\frac {x^2}{6}\right \}\right \}$

Maple

$u \left (x , t\right ) = -\frac {3 t^{2}}{13}+\frac {t x}{13}+\frac {x^{2}}{13}+\mathit {\_F1} \left (\frac {x}{2}+\frac {\left (-6 t +x \right ) \sqrt {13}}{26}\right )+\mathit {\_F2} \left (t +\frac {\left (-1+\sqrt {13}\right ) x}{6}\right )$

________________________________________________________________________________________

##### 5.1.3.8 [384] Practice exam problem Math 5587

problem number 384

From Math 5587 midterm I, Fall 2016, practice exam, problem 10.

Solve for $$u(x,t)$$ with $$u(x,0)=\sin (x)$$ and $$u_t(x,0)=\cos (x)$$ \begin {align*} u_{tt} = u_{xx} \end {align*}

Mathematica

$\left \{\left \{u(x,t)\to \begin {array}{cc} \{ & \begin {array}{cc} \sin (t+x) & t\geq 0 \\ \text {Indeterminate} & \text {True} \\\end {array} \\\end {array}\right \}\right \}$

Maple

$u \left (x , t\right ) = \sin \left (t +x \right )$

________________________________________________________________________________________

##### 5.1.3.9 [385] Practice exam problem Math 5587

problem number 385

From Math 5587 midterm I, Fall 2016, practice exam, problem 11.

Solve for $$u(x,t)$$ with $$u(x,0)=x^2$$ and $$u_t(x,0)=x$$ \begin {align*} u_{tt} = u_{xx} \end {align*}

Mathematica

$\left \{\left \{u(x,t)\to \begin {array}{cc} \{ & \begin {array}{cc} t^2+x t+x^2 & t\geq 0 \\ \text {Indeterminate} & \text {True} \\\end {array} \\\end {array}\right \}\right \}$

Maple

$u \left (x , t\right ) = t^{2}+t x +x^{2}$

________________________________________________________________________________________

##### 5.1.3.10 [386] Practice exam problem Math 5587

problem number 386

From Math 5587 midterm I, Fall 2016, practice exam, problem 12.

Solve for $$u(x,t)$$ with $$u(x,0)=0$$ and $$u_t(x,0)=\frac {4 x}{x^2+1}$$ \begin {align*} u_{tt} = u_{xx} \end {align*}

Mathematica

$\left \{\left \{u(x,t)\to \begin {array}{cc} \{ & \begin {array}{cc} \log \left ((t+x)^2+1\right )-\log \left ((t-x)^2+1\right ) & t\geq 0 \\ \text {Indeterminate} & \text {True} \\\end {array} \\\end {array}\right \}\right \}$

Maple

$u \left (x , t\right ) = -\ln \left (t^{2}-2 t x +x^{2}+1\right )+\ln \left (t^{2}+2 t x +x^{2}+1\right )$

________________________________________________________________________________________

##### 5.1.3.11 [387] zero initial velocity

problem number 387

Solve for $$u(x,t)$$ with $$u(x,0)=\frac {1}{x^2+1}$$ and $$u_t(x,0)=0$$ \begin {align*} u_{tt} = u_{xx} \end {align*}

Mathematica

$\left \{\left \{u(x,t)\to \begin {array}{cc} \{ & \begin {array}{cc} \frac {t^2+x^2+1}{t^4-2 \left (x^2-1\right ) t^2+\left (x^2+1\right )^2} & t\geq 0 \\ \text {Indeterminate} & \text {True} \\\end {array} \\\end {array}\right \}\right \}$

Maple

$u \left (x , t\right ) = \frac {1}{2 \left (-t +x \right )^{2}+2}+\frac {1}{2 \left (t +x \right )^{2}+2}$

Hand solution

Solve the wave equation $$u_{tt}=u_{xx}$$ for inﬁnite domain $$-\infty <x<\infty$$ with initial position $$u\left ( x,0\right ) =\frac {1}{1+x^{2}}$$ and zero initial velocity $$g\left ( x\right ) =0$$.

The solution for wave PDE $$u_{tt}=a^{2}u_{xx}$$ on inﬁnite domain can be given as either series solution, or using D’Alembert solution. Using D’Alembert, the solution is$u\left ( x,t\right ) =\frac {1}{2}\left ( f\left ( x-at\right ) +f\left ( x+at\right ) \right ) +\frac {1}{2a}\int _{x-at}^{x+at}g\left ( s\right ) ds$ But here $$c=1$$ and $$g\left ( x\right )$$ is zero. Therefore the above simpliﬁes to$u\left ( x,t\right ) =\frac {1}{2}\left ( f\left ( x-t\right ) +f\left ( x+t\right ) \right )$ Since $$f\left ( x\right ) =\frac {1}{1+x^{2}}$$, the above becomes$u\left ( x,t\right ) =\frac {1}{2}\left ( \frac {1}{1+\left ( x-t\right ) ^{2}}+\frac {1}{1+\left ( x+t\right ) ^{2}}\right )$

Animation is below

Source code used for the above

________________________________________________________________________________________

##### 5.1.3.12 [388] zero initial velocity

problem number 388

Solve for $$u(x,t)$$ with $$u(x,0)=\sin (x)$$ from $$-\pi <x<\pi$$ and zero everywhere else and $$u_t(x,0)=0$$ \begin {align*} u_{tt} = u_{xx} \end {align*}

Mathematica

$\left \{\left \{u(x,t)\to \begin {array}{cc} \{ & \begin {array}{cc} \frac {1}{2} \left (\left (\begin {array}{cc} \{ & \begin {array}{cc} -\sin (t-x) & t<x+\pi \land x<t+\pi \\ 0 & \text {True} \\\end {array} \\\end {array}\right )+\left (\begin {array}{cc} \{ & \begin {array}{cc} \sin (t+x) & -\pi <t+x<\pi \\ 0 & \text {True} \\\end {array} \\\end {array}\right )\right ) & t\geq 0 \\ \text {Indeterminate} & \text {True} \\\end {array} \\\end {array}\right \}\right \}$

Maple

$u \left (x , t\right ) = -\frac {\left (\left \{\begin {array}{cc}0 & -t +x \le -\pi \\\sin \left (t -x \right ) & -t +x <\pi \\0 & \pi \le -t +x \end {array}\right .\right )}{2}+\frac {\left (\left \{\begin {array}{cc}0 & t +x \le -\pi \\\sin \left (t +x \right ) & t +x <\pi \\0 & \pi \le t +x \end {array}\right .\right )}{2}$

Hand solution

The solution for wave PDE $$u_{tt}=u_{xx}$$ on inﬁnite domain using D’Alembert solution with zero initial velocity is\begin {align*} u\left ( x,t\right ) & =\frac {1}{2}\left ( f\left ( x-t\right ) +f\left ( x+t\right ) \right ) \\ & =\frac {1}{2}\left ( \sin \left ( x-t\right ) +\sin \left ( x+t\right ) \right ) \end {align*}

The following is an animation Here is animation for 10 seconds.

Animation is below

Source code used for the above

________________________________________________________________________________________

##### 5.1.3.13 [389] General case $$u_{tt} = u_{xx}$$ with $$u(x,0)=\sin x, u_t(x,0)=-2 x e^{-x^2}$$

problem number 389

Taken from Final exam, Math 5587 UMN, Fall 2016.

Solve for $$u(x,t)$$ for all $$x$$ and $$t>0$$ with $$u(x,0)=\sin (x)$$ and $$u_t(x,0)=-2 x e^{-x^2}$$ \begin {align*} u_{tt} = u_{xx} \end {align*}

Mathematica

$\left \{\left \{u(x,t)\to \begin {array}{cc} \{ & \begin {array}{cc} \frac {1}{2} \left (2 \cos (t) \sin (x)-e^{-(t-x)^2}+e^{-(t+x)^2}\right ) & t\geq 0 \\ \text {Indeterminate} & \text {True} \\\end {array} \\\end {array}\right \}\right \}$

Maple

$u \left (x , t\right ) = -\frac {{\mathrm e}^{-\left (t -x \right )^{2}}}{2}+\frac {{\mathrm e}^{-\left (t +x \right )^{2}}}{2}-\frac {\sin \left (t -x \right )}{2}+\frac {\sin \left (t +x \right )}{2}$

________________________________________________________________________________________

##### 5.1.3.14 [390] General case. $$u_{tt} =u_{xx}$$ dAlembert solution, box function as initial position

problem number 390

Taken from Peter Olver textbook, Introduction to Partial diﬀerential equations. Problem 2.4.2

Solve for $$u(x,t)$$ for all $$x$$ and $$t>0$$ with $$u(x,0)=1$$ for $$1<x<2$$ and zero otherwise. $$u_t(x,0)=0$$ \begin {align*} u_{tt} = u_{xx} \end {align*}

Mathematica

$\left \{\left \{u(x,t)\to \begin {array}{cc} \{ & \begin {array}{cc} \frac {1}{2} \left (\left (\begin {array}{cc} \{ & \begin {array}{cc} 1 & 1<x-t<2 \\ 0 & \text {True} \\\end {array} \\\end {array}\right )+\left (\begin {array}{cc} \{ & \begin {array}{cc} 1 & 1<t+x<2 \\ 0 & \text {True} \\\end {array} \\\end {array}\right )\right ) & t\geq 0 \\ \text {Indeterminate} & \text {True} \\\end {array} \\\end {array}\right \}\right \}$

Maple

$u \left (x , t\right ) = \left (\left \{\begin {array}{cc}0 & -t +x \le 1 \\\frac {1}{2} & -t +x <2 \\0 & 2\le -t +x \end {array}\right .\right )+\left (\left \{\begin {array}{cc}0 & t +x \le 1 \\\frac {1}{2} & t +x <2 \\0 & 2\le t +x \end {array}\right .\right )$

Hand solution

Solve the wave equation $$u_{tt}=u_{xx}$$ when the initial displacement is the box function $$u\left ( 0,x\right ) =\left \{ \begin {array} [c]{ccc}1 & & 1<x<2\\ 0 & & \text {otherwise}\end {array} \right .$$, while the initial velocity is zero.

Solution

d’Alembert solution of the wave equation is

$u\left ( t,x\right ) =\frac {1}{2}\left ( f\left ( x-ct\right ) +f\left ( x+ct\right ) \right ) +\frac {1}{2c}\int _{x-ct}^{x+ct}g\left ( s\right ) ds$

Where $$c$$ is the wave speed which is $$c=1$$ in this problem and $$f\left ( x\right ) =u\left ( 0,x\right )$$ and $$g\left ( x\right ) =u_{t}\left ( 0,x\right ) =0$$ in this problem. Hence the above simpiﬁes to

\begin {align*} u\left ( t,x\right ) & =\frac {1}{2}\left ( f\left ( x-t\right ) +f\left ( x+t\right ) \right ) \\ & =\frac {1}{2}\left ( \left \{ \begin {array} [c]{ccc}1 & & 1<x-t<2\\ 0 & & \text {otherwise}\end {array} \right . +\left \{ \begin {array} [c]{ccc}1 & & 1<x+t<2\\ 0 & & \text {otherwise}\end {array} \right . \right ) \end {align*}

The following is an animation of the solution

Source code used for the above

________________________________________________________________________________________

##### 5.1.3.15 [391] $$u_{tt}=4 u_{xx}+ \cos (t)$$ dAlembert solution with $$u(x,0)=\sin x,u_t(x,0)=\cos x$$

problem number 391

Exam 1 problem, math 5587, fall 2019, UMN.

Solve for $$u(x,t)$$ \begin {align*} u_{tt} = 4 u_{xx} +\cos (t) \end {align*}

With initial conditions $$u(x,0)=\sin x,u_t(x,0)=\cos x$$

Mathematica

$\left \{\left \{u(x,t)\to \begin {array}{cc} \{ & \begin {array}{cc} \sin (x) \cos ^2(t)+(\cos (x) \sin (t)-1) \cos (t)-\sin ^2(t) \sin (x)+1 & t\geq 0 \\ \text {Indeterminate} & \text {True} \\\end {array} \\\end {array}\right \}\right \}$

Maple

$u \left (x , t\right ) = -\cos (t )-\frac {\sin \left (2 t -x \right )}{4}+\frac {3 \sin \left (2 t +x \right )}{4}+1$

Hand solution

Solve the wave equation $$u_{tt}=4u_{xx}+\cos t$$ when initial conditions $$u\left ( x,0\right ) =\sin x,u_{t}\left ( x,0\right ) =\cos x$$

Solution

d’Alembert solution of the wave equation is$u\left ( t,x\right ) =\frac {1}{2}\left ( f\left ( x-ct\right ) +f\left ( x+ct\right ) \right ) +\frac {1}{2c}\int _{x-ct}^{x+ct}g\left ( s\right ) ds+\frac {1}{2c}\int _{0}^{t}\int _{x-c\left ( t-s\right ) }^{x+c\left ( t-s\right ) }F\left ( s\right ) dyds$ Where $$c$$ is the wave speed which is $$c=2$$ in this problem and $$f\left ( x\right ) =u\left ( 0,x\right ) =\sin x$$ and $$g\left ( x\right ) =u_{t}\left ( 0,x\right ) =\cos x$$ and the force $$F\left ( t\right ) =\cos t$$ in this problem. Hence the above simpiﬁes to$u\left ( t,x\right ) =\frac {1}{2}\left ( \sin \left ( x-2t\right ) +\sin \left ( x+2t\right ) \right ) +\frac {1}{4}\int _{x-2t}^{x+2t}\cos \left ( s\right ) ds+\frac {1}{4}\int _{0}^{t}\int _{x-2\left ( t-s\right ) }^{x+2\left ( t-s\right ) }\cos \left ( s\right ) dyds$ But $$\frac {1}{4}\int _{x-2t}^{x+2t}\cos \left ( s\right ) ds=\frac {1}{4}\left [ \sin \left ( s\right ) \right ] _{x-2t}^{x+2t}=\frac {1}{4}\left ( \sin \left ( x+2t\right ) -\sin \left ( x-2t\right ) \right )$$. Hence the above becomes\begin {align} u\left ( t,x\right ) & =\frac {1}{2}\left ( \sin \left ( x-2t\right ) +\sin \left ( x+2t\right ) \right ) +\frac {1}{4}\left ( \sin \left ( x+2t\right ) -\sin \left ( x-2t\right ) \right ) +\frac {1}{4}\int _{0}^{t}\int _{x-2\left ( t-s\right ) }^{x+2\left ( t-s\right ) }\cos \left ( s\right ) dyds\nonumber \\ & =\frac {1}{4}\sin \left ( x-2t\right ) +\frac {3}{4}\sin \left ( x+2t\right ) +\frac {1}{4}\int _{0}^{t}\int _{x-c\left ( t-s\right ) }^{x+c\left ( t-s\right ) }\cos \left ( s\right ) dyds\tag {1A} \end {align}

But \begin {align} \frac {1}{4}\int _{0}^{t}\int _{x-2\left ( t-s\right ) }^{x+2\left ( t-s\right ) }\cos \left ( s\right ) dyds & =\frac {1}{4}\int _{0}^{t}\cos \left ( s\right ) \int _{x-2\left ( t-s\right ) }^{x+2\left ( t-s\right ) }dyds\nonumber \\ & =\frac {1}{4}\int _{0}^{t}\cos \left ( s\right ) \left ( x+2\left ( t-s\right ) -x+2\left ( t-s\right ) \right ) ds\nonumber \\ & =\frac {1}{4}\int _{0}^{t}\cos \left ( s\right ) \left ( 2\left ( t-s\right ) +2\left ( t-s\right ) \right ) ds\nonumber \\ & =\frac {1}{4}\int _{0}^{t}\cos \left ( s\right ) \left ( 2t-2s+2t-2s\right ) ds\nonumber \\ & =\int _{0}^{t}\cos \left ( s\right ) \left ( t-s\right ) ds\nonumber \\ & =\int _{0}^{t}t\cos \left ( s\right ) ds-\int _{0}^{t}s\cos \left ( s\right ) ds\nonumber \\ & =t\left [ \sin \left ( s\right ) \right ] _{0}^{t}-\int _{0}^{t}s\cos \left ( s\right ) ds\nonumber \\ & =t\sin t-\int _{0}^{t}s\cos \left ( s\right ) ds\tag {1} \end {align}

Integration by parts. $$udv=uv-\int vdu$$. Let $$u=s,dv=\cos s$$, then $$du=1,v=\sin \left ( s\right )$$, then \begin {align} \int _{0}^{t}s\cos \left ( s\right ) ds & =\left [ s\sin \left ( s\right ) \right ] _{0}^{t}-\int _{0}^{t}\sin sds\nonumber \\ & =t\sin t-\left [ -\cos s\right ] _{0}^{t}\nonumber \\ & =t\sin t+\left ( \cos t-1\right ) \tag {2} \end {align}

Using (2) in (1) gives\begin {align*} \frac {1}{4}\int _{0}^{t}\int _{x-2\left ( t-s\right ) }^{x+2\left ( t-s\right ) }\cos \left ( s\right ) dyds & =t\sin t-\left ( t\sin t+\left ( \cos t-1\right ) \right ) \\ & =1-\cos t \end {align*}

Substituting the above in (1A) gives$u\left ( x,t\right ) =\frac {1}{4}\sin \left ( x-2t\right ) +\frac {3}{4}\sin \left ( x+2t\right ) +1-\cos t$ The following is an animation of the solution

Source code used for the above

________________________________________________________________________________________

##### 5.1.3.16 [392] $$u_{tt}=c^2 u_{xx}$$ dAlembert solution with $$u(x,0)=\delta (x-a),u_t(x,0)=0$$

problem number 392

Problem 6.3.27 Introduction to Partial Diﬀerential Equations by Peter Olver, ISBN 9783319020983.

Consider the wave equation $$u_{tt}=c^{2}u_{xx}$$ on the line $$-\infty <x<\infty$$. Use the d’Alembert formula to solve the initial value problem $$u\left ( x,0\right ) =\delta \left ( x-a\right ) ,u_{t}\left ( x,0\right ) =0$$. \begin {equation} u\left ( x,t\right ) =\frac {1}{2}\left ( f\left ( x-ct\right ) +f\left ( x+ct\right ) \right ) +\frac {1}{2c}\int _{x-ct}^{x+ct}g\left ( s\right ) ds \tag {2.82} \end {equation}

Mathematica

$\left \{\left \{u(x,t)\to \begin {array}{cc} \{ & \begin {array}{cc} \delta (x-a) & x\geq 0\land t=0 \\ \frac {2 \int _0^{\infty }\cos (a K[1]) \cos \left (\sqrt {c^2} t K[1]\right ) \cos (x K[1])dK[1]}{\pi } & x\geq 0\land t>0 \\ \text {Indeterminate} & \text {True} \\\end {array} \\\end {array}\right \}\right \}$

Maple

$u \left (x , t\right ) = \frac {\delta \left (-c t +a -x \right )}{2}+\frac {\delta \left (c t +a -x \right )}{2}$

Hand solution

\begin {equation} u\left ( x,t\right ) =\frac {1}{2}\left ( f\left ( x-ct\right ) +f\left ( x+ct\right ) \right ) +\frac {1}{2c}\int _{x-ct}^{x+ct}g\left ( s\right ) ds \tag {2.82} \end {equation}

In (2.82), the function $$f$$ is the initial conditions and the function $$g$$ is the initial velocity. Hence the above becomes$u\left ( x,t\right ) =\frac {1}{2}\left ( \delta \left ( \left ( x-a\right ) -ct\right ) +\delta \left ( \left ( x-a\right ) +ct\right ) \right )$ But $$\delta \left ( \left ( x-a\right ) -ct\right ) =\delta \left ( x-a-ct\right ) =\delta \left ( x-\left ( a+ct\right ) \right )$$ and $$\delta \left ( \left ( x-a\right ) +ct\right ) =\delta \left ( x-a+ct\right ) =\delta \left ( x-\left ( a-ct\right ) \right )$$. Hence the above becomes\begin {equation} u\left ( x,t\right ) =\frac {1}{2}\delta \left ( x-\left ( a+ct\right ) \right ) +\frac {1}{2}\delta \left ( x-\left ( a-ct\right ) \right ) \tag {1} \end {equation} The above is two half strength delta pulses, one traveling to the left and one traveling to the right from the starting position.

________________________________________________________________________________________

##### 5.1.3.17 [393] system of 2 inhomogeneous linear hyperbolic system with constant coeﬃcients

problem number 393

From Mathematica DSolve help pages

Solve for $$u(x,t),v(x,t)$$

\begin {align*} \frac {\partial u}{\partial t} &= \frac {\partial v}{\partial x}+1\\ \frac {\partial v}{\partial t} &= -\frac {\partial u}{\partial x}-1 \end {align*}

With initial conditions \begin {align*} u(x,0) &= \cos ^2 x\\ v(x,0) &= \sin x \end {align*}

Mathematica

$\left \{\left \{u(x,t)\to \sinh (t) \cos (x)+\frac {1}{2} \cosh (2 t) \cos (2 x)+t+\frac {1}{2},v(x,t)\to \cosh (t) \sin (x) (2 \sinh (t) \cos (x)+1)-t\right \}\right \}$

Maple

sol=()