# Solve a first order partial differential equation with the boundary condition $u(x,x+x^2)=\sin(x)$ instead of a initial value.

The problem I want to solve is the following one: $$\begin{cases} u_x + u_t + u = 1,\\ u(x,x+x^2)=\sin(x). \end{cases}$$ I know how to use method of characteristic only if a initial value condition is given in $$t=0$$: loosely speaking I know how to deal with boundary conditions in the form $$u_0(x)=u(x,0)$$. What is the solution in the above case? Thanks!

• According to Mathematica the solution is $u(x,\, t) = e^{-\sqrt{t - x} - x} \cdot \left(e^{\sqrt{t - x} + x} - \sin\left( \sqrt{t - x} \right) - 1 \right))$. Wolfram|Alpha confirms this. Code: DSolve[{D[u[x, t], x] + D[u[x, t], t] + u[x, t] == 1, u[x, x + x^2] == Sin[x]}, u[x, t], {x, t}] Commented Feb 6 at 12:53
• Thanks! However Mathematica solution wouldn't tell me enough about how to solve problems like this, thus I'm interested in step-by-step solution. Commented Feb 6 at 13:03
• The basic idea of method of characteristic is along the characteristic, you know the behavior of $u$. To compute the value of $u$ at a $(x,t)$, you first figure out the characteristic passes through that point and then the location where this characteristic intersect the boundary. In this case, the characteristic are straight lines $x - t = const$. so if $(x_0,x_0+x_0^2)$ is the point of interesction, then $x_0 = \sqrt{t - x}$. The remaining treatment isn't that different from the case whether the boundary is along the $x$-axis. Commented Feb 6 at 13:24

The characteristic curves satisfy the ODEs \begin{align} \dot{x}(s)&=1, \tag{1} \\ \dot{t}(s)&=1, \tag{2} \\ \dot{u}(s)&=1-u. \tag{3} \end{align} Solving them, with initial conditions $$x(0)=x_0, t(0)=t_0,$$ and $$u(0)=u_0$$, we obtain \begin{align} x&=x_0+s, \tag{4} \\ t&=t_0+s, \tag{5} \\ u&=1+(u_0-1)e^{-s}. \tag{6} \end{align} The boundary condition $$u(x,x+x^2)=\sin(x)$$ is equivalent to \begin{align} t_0&=x_0+x_0^2, \tag{7} \\ u_0&=\sin(x_0). \tag{8} \end{align} Plugging $$(7)$$ into $$(5)$$ and solving $$(4)$$-$$(5)$$ for $$x_0$$ and $$s$$, we obtain \begin{align} x_0&=\sqrt{t-x}, \tag{9} \\ s&=x-\sqrt{t-x}. \tag{10} \end{align} Finally, plugging $$(8)$$-$$(10)$$ into $$(6)$$, we obtain $$u(x,t)=1+e^{-x+\sqrt{t-x}}\left(\sin(\sqrt{t-x})-1\right). \tag{11}$$