Consider the reaction-diffusion PDE: $$\partial_t m(x,t) = f(x,t) \, m(x,t) + K \, \partial_x^2 m(x,t)\,, \qquad m(x,t=0) = \frac{\exp\lbrace-x^2/(2\sigma_0^2)\rbrace}{\sqrt{2\pi\sigma_0^2}}$$ for $x\in (-\infty,\infty)$ and $t \in [0,T]$. Assuming $$\int_{-\infty}^\infty dx \int_0^{T} dt \, f(x,t) = \mathrm{cnst.} \qquad \text{and} \qquad f(x,t) \geq 0 $$ My goal is to gain some information on what profile of the forcing term $f(x,t)$ maximizes the final value of $m$ at the origin, i.e., $m(x=0,T)$. For example, it seems plausible from symmetry arguments that the optimal $f$ should be an even function of $x$. In addition, considering the fact that only diffusion can transport $m$ from other positions on the $x$ axis to $x=0$, one may intuitively argue that at time $t$, the optimal $f$ should be mostly distributed on an interval of radius $\sim \sqrt{K(T-t)}$ around $x=0$.
Q1 Given the linearity of the PDE, are there specific classes of forcing profiles $f$ (eg, Gaussian, exponential, etc) for which the PDE can be directly solved and the result be optimized based on the parameters that defined the profile (eg, time-dependent variance for a Gaussian profile, time-dependent decay rate for an exponential function, etc)?
Q2 (Probably the harder question) Is there a systematic way to find the optimal shape of $f$ (ie whether it should be, approximately, a Gaussian, exponential, box function, etc), or otherwise obtain some qualitative understanding of the shape? I have no idea how to even begin formulating this and what are some relevant techniques to approach such extremization problems.
Update The solution to the PDE may formally be written, through the Suzuki-Trotter decomposition, as $$ m(x,T) = \lim_{\delta t\to 0} (e^{\delta t K \partial_x^2} e^{\delta t f(x,(N-1)\delta t)} ) \ldots (e^{\delta t K \partial_x^2} e^{\delta t f(x,\delta t)} ) (e^{\delta t K \partial_x^2} e^{\delta t f(x,0)} ) m(x,0) $$ where $\delta t = T/N$. The infinitesimal operators may be ordered (all forcing terms to the left and all diffusion terms to the right) by making use of the Zussenhaus formula to second order in $\delta t$: \begin{equation} m(x,T) = e^{\int_0^T dt f(x,t)} e^{(\delta t)^2 \sum_{j=1}^N j C_j} e^{TK\partial_x^2}m(x,0) \end{equation} with $C_j$ is the commutator arising from changing the order of $f(x,(M-j+1)\delta t)$ $K\delta t \partial_x^2$: $$ e^{K\delta t \partial_x^2} e^{\delta t f(x,(M-j+1)\delta t)} = e^{\delta t f(x,(M-j+1)\delta t)} e^{K\delta t \partial_x^2} e^{(\delta t)^2 C_j} + O(\delta t^3) $$ where $C_j = K \left(\partial_x^2 f(x,(M-j+1)\delta t) +2\left(\partial_x f(x,(M-j+1)\delta t)\right)\partial_x \right)$. In the limit of $N \to \infty$ and $\delta t =T/N \to 0$, after changing the summation index, we get $$ (\delta t)^2 \sum_{j=1}^N j C_j \to \int_0^T dt \hspace{0.05cm} K (T-t) \left(\partial_x^2 f(x,t) + 2\partial_x f(x,t) \partial_x \right) $$
and therefore the solution may be written as \begin{equation} m(x,T) = e^{\int_0^T f(x,t) dt} e^{\int_0^T dt \hspace{0.05cm} K (T-t) \left( \partial_x^2 f(x,t) + 2\partial_x f \partial_x \right)} e^{TK\partial_x^2} m(x,0) \end{equation}
This solution, if valid, holds for a general forcing term $f$. It, however, still contains the non-trivial operator $\partial_x f \partial_x$ in the exponent. To use it for the maximization problem above, we first the symmetry of $f$ mentioned earlier and may argue that $\partial_x f\big\rvert_{x=0} = 0$ if $f$ is the optimal profile. We are then only left with \begin{align} m(x=0,T) &= e^{\int_0^T f(0,t) dt} e^{\int_0^T dt \hspace{0.05cm} K (T-t) \partial_x^2 f(0,t)} e^{TK\partial_x^2} m(x,0) . \end{align} Since the first two terms only contain scalar operators, they can be combined to get \begin{equation} m(x=0,T) = e^{\int_0^T dt \left( f(0,t) + K(T-t)\partial_x^2 f(0,t) \right)} e^{TK\partial_x^2} m(x,0) \end{equation} or more explicitly \begin{equation} m(x=0,T) = e^{\int_0^T dt \left( f(0,t) + K(T-t)\partial_x^2 f(0,t) \right)} \int dy \frac{e^{\frac{-y^2}{4KT}}}{\sqrt{4\pi KT}} m(y,0) \end{equation}
The integral part represents the diffusive spread of the initial profile from all $y \in \mathbb{R}$ to $x=0$. The exponential factor is the dependence of the final $m(x=0,T)$ on the forcing profile $f$.
Q: Are all the manipulations performed above valid (the Trotter decomposition of the formal solution, the ordering of the operators, discarding the $\partial_x$ operator given the assumption)? If so, this formal solution to the PDE is rather simple as it only depends on $f(x=0,t)$ and its second derivative.
PS: I just realized it is not valid to simply set $\partial_x f \partial_x$ to zero, since this term, being in the exponential, generates terms such as $\left(\partial_x f \partial_x \right)^s \, e^{TK\partial_x^2}m(x,0)$ whose result depends on the higher-order deriverates of $f$ and $m_0$.