# A Finite difference of fourth order partial differential

1. Aug 30, 2017

### Hypatio

What is a finite difference discretization for the fourth-order partial differential terms

$\frac{\partial u}{\partial x}k\frac{\partial u}{\partial x}\frac{\partial u}{\partial x}k(x,y)\frac{\partial u}{\partial x}$
and
$\frac{\partial u}{\partial x}k(x,y) \frac{\partial u}{\partial y} \frac{\partial u}{\partial x} k(x,y)\frac{\partial u}{\partial y}$

with the variable coefficient k. I'm not certain if I have written them correctly. These terms should appear in the equation

$\nabla\cdot\nabla(k\nabla^2 u)$

I know that for constant k the following respective discretizations work:

k[u(x-2,y+0) - 4u(x-1,y+0) + 6u(x+0,y+0) - 4u(x+1,y+0) + u(x+2,y+0)]

and

k[u(x-1,y+1) - 2u(x+0,y+1) + u(x+1,y+1)
- 2u(x-1,y+0) + 4u(x+0,y+0) - 2u(x+1,y+0)
+ u(x-1,y-1) - 2u(x+0,y-1) + u(x+1,y-1)]

but what are the equivalent forms with variable k?

2. Aug 30, 2017

### NFuller

No. The Laplacian is a second order derivative, yet there are only first derivatives in your expansion.
Google finite difference coefficients to find the discretizations you need. Here's some from wikipedia https://en.wikipedia.org/wiki/Finite_difference_coefficient

3. Aug 30, 2017

### Hypatio

The terms should be fourth order derivatives if the variable k is constant. They come from the term I provided before (but is more correct here): $\nabla\cdot\nabla(\nabla\cdot k\nabla u)$

None of these include the function k(x,y). What I need to know is how the function k(x,y) is distributed in the finite-difference terms since it is variable.

4. Aug 30, 2017

### NFuller

I said the Laplacian is second order. You are correct that the equation you wrote is fourth order, but my point is that your expansion contains only first order derivatives.

First, try to write out $\nabla\cdot\nabla(k\nabla^{2}u)$ in Cartesian coordinates using the product rule to deal with $k$.

5. Aug 30, 2017

### Hypatio

Alright, I looked at this more carefully and I think the correct expansion of my equation is

$\frac{\partial^3}{\partial x^3}k\frac{\partial u}{\partial x}+\frac{\partial^2}{\partial x^2}\frac{\partial }{\partial y}k\frac{\partial u}{\partial y}+\frac{\partial^2}{\partial y^2}\frac{\partial}{\partial x}k\frac{\partial u}{\partial x}+\frac{\partial^3}{\partial y^3}k\frac{\partial u}{\partial y}$

I'm unsure of how the product rule will help me determine what spatial values of k will occur where in the finite-difference terms.

6. Sep 19, 2017

### Staff: Mentor

What is the actual equation you're trying to solve?

7. Oct 8, 2017

### Telemachus

There are different ways of doing this. You could expand the operator, and obtain explicitly the derivatives of k, for example. You can also let it as it comes, and work it out that way, it can also be done that way. But fundamentally it depends in what order of approximation you want for the operator. We are not going to do your homework in here, we will help you to understand how to do it.

So, for example you have a gradient, how do you discretize it? $\nabla u(x,y)=\frac{\partial u(x,y)}{\partial x}\hat x+\frac{\partial u(x,y)}{\partial y}\hat y$, what would you do with that in order to get a discretized version of it? do you know how to obtain a finite difference formula for a given derivative?