# Hard derivative

1. Dec 12, 2013

### dawozel

The problem statement, all variables and given/known data

ψ2 = A(2αx2- 1)e-αx2/2

First, calculate dψ2/dx, using A for A, x for x, and a for α.

Second, calculate d2ψ2/dx2.

3. The attempt at a solution
so I got the first derivative correct, it was

A((4*a*x)*exp((-a*x^2)/2) +(2*a*x^2 -1)*(-a*x*exp((-a*x^2)/2)))

but i can seem to calculate the second derivative correctly I'm getting
A((4*a)*(exp((-ax^2)/2)) + (4*a*x)*(-a*x*exp((-ax^2)/2)) +(4*a*x)*(-a*x*exp((-ax^2)/2)) +(2*a*x^2 -1)*(a^2*x^2*exp((-ax^2)/2)))

but this incorrect, am I missing something?

2. Dec 12, 2013

### Staff: Mentor

This is just about impossible to read. I could take a guess at what you're trying to say, but I shouldn't have to. Take a look at this, especially #2: https://www.physicsforums.com/showthread.php?t=617567.

3. Dec 12, 2013

### dawozel

My bad this is the second derivative
$A((4a)(exp(( - ax^2 ) / 2)) + (4ax) * ( - ax * exp(( - ax^2) /2)) + (4ax) * ( - a xexp(( - ax^2 ) / 2)) + (2ax - 1) (a^2x^2 *exp(( - ax^2 ) / 2)))$

4. Dec 12, 2013

### Staff: Mentor

That's a lot better.

Is this ψ2?

Here's what you have, cleaned up a little more, using more LaTeX and fewer parentheses.
$$A((4a)(e^{ - (a/2)x^2}) + (4ax) * ( - ax * e^{-(a/2)x^2}) + (4ax) * ( - a xe^{- (a/2)x^2}) + (2ax - 1) (a^2x^2 *e^{- (a/2)x^2})$$

This ought to be at least close to what you have.

Last edited: Dec 12, 2013
5. Dec 12, 2013

### Hepth

Take a look at your last term, and consider the Product Rule. You missed something.

6. Dec 12, 2013

### scurty

This is the first derivative, correct?

$A[4axe^{-ax^2/2}+(2ax^2-1)(-axe^{-ax^2/2})]$

If so, in your computation of the second derivative, you need to perform a product rule within a product rule.

7. Dec 12, 2013

### dawozel

yes that's my first derivative

8. Dec 12, 2013

### dawozel

So my first derivative was simplified to $\frac{d}{dx}\psi_2(x)=A\left[4\alpha x e^{-\frac{1}{2}\alpha x^2} - (2\alpha x^2 - 1)\alpha x e^{-\frac{1}{2}\alpha x^2}\right]$

and if i factor out the $\alpha x \exp(-\frac{1}{2}\alpha x^2)$

i get that

$\frac{d}{dx}\psi_2(x) = A(\alpha x \exp(-\frac{1}{2}\alpha x^2))(5-2ax^2)$

so my second derivative should be
$A(((aexp((-1/2)ax^2) + (-a^2x^2exp((-1/2)ax^2)) +(4ax))$

is this right?

Last edited: Dec 12, 2013
9. Dec 12, 2013

### scurty

Looks good to me. Can you differentiate that now?

10. Dec 12, 2013

### dawozel

so my second derivative should be
$A(((aexp((-1/2)ax^2) + (-a^2x^2exp((-1/2)ax^2)) +(4ax))$

is this right or am i still missing a product rule?

11. Dec 12, 2013

### scurty

Still missing a bit. Try doing this in two steps. Let $f(x) = \alpha x \exp(-\frac{1}{2}\alpha x^2)$ and $g(x) = 5-2ax^2$

What is the derivative of $\frac{d}{dx}\psi_2(x) = Af(x)g(x)$? (simple application of product rule)

After that, calulate $f'(x)$ and $g'(x)$ and then plug everything into the the second derivative formula you got.

I know this is a lot of tedious work but I hope you'll be able to see why you were leaving out the terms you did.

12. Dec 12, 2013

### dawozel

Hmmmm i may be forgetting to multiply the $F' (x) by G(x)$ and vice versa

Is the derivative closer to

$A((((aexp((-1/2)ax^2) + (-a^2x^2exp((-1/2)ax^2))(5-2ax^2) + (4ax)( \alpha x \exp(-\frac{1}{2}\alpha x^2))$

13. Dec 13, 2013

### scurty

That looks better. You were just forgetting to put in that very last term. One minor issue with a sign error, the derivative of $5-2\alpha x^2$ is $-4\alpha x$ so you need a minus sign in the one place.

And there's a bunch of parentheses; I'll just assume that they line up correctly. Just double check them if you are submitting them for homework.

14. Dec 13, 2013