# Would this be a general formula for the gradient of a function r^n?

1. Jan 27, 2017

### grandpa2390

Had to find the general formula for the gradient of a function r^n. r is the length of the vector connecting (x,y,z) with (x',y',z')

I took the gradient of r^n and simplified it. If I plug in any number for in in r^n and go through the process, I will get the same result as if I take this function and plug that number into n at the end.
Does that make sense? Would this be considered the general formula.

2. Jan 27, 2017

### Staff: Mentor

I moved the thread to our homework section.

It would help to see the formulas you got.

In general, it should not matter when you plug in values - and in the general case you don't even have to do that.

3. Jan 27, 2017

### grandpa2390

I plugged in values to check.

let R be the vector (x-x')+(y-y')+(z-z')
let r be the length (sqrt of (x-x')^2...
R' be the unit vector

I get the general formula for del(r^n) as (n*R)/(n^(2-n)) or (n*R')/(r^(1-n))
I plugged in a number for n to check if my result would give me the same answer as if I used that number instead of n and it does. Does that mean that this is a general formula?

4. Jan 27, 2017

### haruspex

I guess you mean (n*R)/(r^(2-n)).
In LaTeX, you have
$\nabla|\vec R|^n=n\vec R|\vec R|^{n-2}$, right?