construct $\mathcal{O}(h^2)$ finite difference scheme for $(a(x)\cdot u'(x))'$ operator Obviously, Taylor expansion for $(a(x)\cdot u'(x))'$ is to be used somehow, but I'm not sure how to start at all...  The scheme that I'm looking to derive is actually $\frac{(a\cdot u_{\bar{x}})_{x}+(a\cdot u_{x})_{\bar{x}}}{2}$, where $v_{x}=\frac{v(x+h)-v(x)}{h}$ is forward difference and $v_{\bar{x}}=\frac{v(x)-v(x-h)}{h}$ is backward difference (and $h$ is, of course, finite differences grid step), but any other scheme, or a hint on how to start constructing a scheme, would do.
 A: You need a fourth-order accurate first derivative finite-difference approximation so that when it's multiplied by another fourth order accurate first derivative, it becomes third-order accurate. A fourth-order accurate first derivative is given by
\begin{align}
\frac{d}{dx}u(x) = \frac{u(x-2h)-8u(x-h) + 8u(x+h)-u(x+2h)}{12h} + \mathcal{O}(h^{4})
\end{align}
and a fourth order accurate second derivative is given by
\begin{align}
\frac{d^2}{dx^{2}}u(x) = \frac{u(x+h) -2u(x) + u(x-h)}{h^2} + \mathcal{O}(h^{2})
\end{align}
Using the product rule, we have
\begin{align}
\frac{d}{dx}\left(a(x)\frac{d}{dx} u(x) \right) 
&= \frac{d}{dx}a(x) \frac{d}{dx}u(x) + a(x) \frac{d^2}{dx^{2}}u(x) \\
&=  \left(\frac{u(x-2h)-8u(x-h) + 8u(x+h)-u(x+2h)}{12h}\right)\\&\phantom{=}\cdot\left(\frac{a(x-2h)-8a(x-h) + 8a(x+h)-a(x+2h)}{12h}\right) \\
&\phantom{=} +  a(x)\frac{u(x+h) -2u(x) + u(x-h)}{h^2} + \mathcal{O}(h^{2})
\end{align}
A: A very useful second order accurate discretisation is given by

$$(au')' = \frac{a_{x+h/2}u_{x+h} + a_{x-h/2}u_{x-h} - (a_{x-h/2}+a_{x+h/2})u_x}{h^2} + \mathcal{O}(h^2)$$

where $a_{x\pm h/2} \equiv \frac{1}{2}(a_x + a_{x\pm h})$. To prove that this discretisation is second order follows from writing
$$(au')' = au'' + a'u'$$
The first term to second order is
$$au'' = a_x\frac{u_{x+h} + u_{x-h}-2u_x}{h^2} + \mathcal{O}(h^2)$$
The second term to second order is
$$a'u' = \frac{1}{2}\left(\frac{u_{x+h} - u_x}{h}\frac{a_{x+h} - a_x}{h} + \frac{u_{x-h} - u_x}{h}\frac{a_{x-h} - a_x}{h}\right) + \mathcal{O}(h^2)$$
This follows from
$$\frac{u_{x+h} - u_x}{h}\frac{a_{x+h} - a_x}{h} = [u_x' + u_x'' \frac{h}{2} + \mathcal{O}(h^2)][a_x' + a_x'' \frac{h}{2} + \mathcal{O}(h^2)]$$
$$\frac{u_{x-h} - u_x}{h}\frac{a_{x-h} - a_x}{h} = [-u_x' + u_x'' \frac{h}{2} + \mathcal{O}(h^2)][-a_x' + a_x'' \frac{h}{2} + \mathcal{O}(h^2)]$$
By combinding the two discretisations for $au''$ and $a'u'$ we obtain the discretisation quoted in the begining.
