# Deriving function

1. Jun 19, 2013

### Asla

1. The problem statement, all variables and given/known data

let f(a)=∫20|x(x-a) dx for 0≤a≤2
a)Find the function f(a)

3. The attempt at a solution
I think the function can be given by this but what I get does not seem to be the correct answer.
a0x(x-a)dx -∫2ax(x-a)dx
The correct answer is supposed to be 1/3a3-2a+8\3

2. Jun 19, 2013

### Curious3141

Why would you think you can split the integral up that way? You do have to split up the integral, but the way you did it makes no sense (why is there a minus sign before the second term)?

The given answer is correct, BTW.

You should start by splitting up the bounds so you can remove the absolute value sign. Figure out when the expression inside the "| |" is positive, and when it's negative.

3. Jun 19, 2013

### Asla

I am having a hard time doing that.I am totally lost because of the 0≤a≤2 part.Give me a hint please.

4. Jun 19, 2013

### Curious3141

OK, split the integral up like this: $\int_0^a g(x)dx +\int_a^2 h(x)dx$. Neither $g(x)$ nor $h(x)$ involve the absolute value notation. They're simple polynomial functions.

$g(x)$ corresponds to the expression $|x(x-a)|$ when $x \leq a$. Can you figure out what $g(x)$ should be?

Likewise, $h(x)$ corresponds to the expression $|x(x-a)|$ when $x \geq a$. Can you figure out what $h(x)$ should be?

5. Jun 19, 2013

### Asla

Let me try g(x) could it be ∫a0x(x-1)dx ? and h(x) be ∫2ax(x-a)dx?

Last edited: Jun 19, 2013
6. Jun 19, 2013

### haruspex

h is right but not g. If you don't know whether x > or < a, there are two possibilities for |x-a|. What are they?

7. Jun 19, 2013

### Asla

For g(x) x cannot be greater than a it can either be equal or less than a,..huh?

8. Jun 19, 2013

### Staff: Mentor

You were so close to getting this correct, all you needed was to multiply your answer to the above by -1 and you would have got the correct answer. It's a bit mystifying how you managed to get the negative of the answer, though.

You have plotted a sample graph, have you, so you can clearly see what you are dealing with? http://m.wolframalpha.com/input/?i=graph+x(x-1.2)+x>0,x<2+&x=0&y=0

9. Jun 19, 2013

### haruspex

Forget g for the moment, I was asking a general question. If x is unknown then |x| is either x or -x, depending on the sign of x, right? So what are the possibilities for |x(x-a)|? Which of them happens when 0 < x < a?

10. Jun 19, 2013

### SammyS

Staff Emeritus
Where is the right hand vertical bar for the "absolute value"?

Is the integral supposed to be $\displaystyle \int_0^2 |\,x(x-a) \,|\ \, dx\ ?$

Also, I'm moving this thread to "Calculus & Beyond" .

11. Jun 20, 2013

### HallsofIvy

Staff Emeritus
If $$0\le x\le a$$ then $$x(x- a)\le 0$$ so $$|x(x- a)|= x(a- x)= ax- x^2$$

If $$a\le x\le 2$$ then $$x(x- a)\ge 0$$ so $$|x(x- a)|= x(x- a)= x^2- ax$$

$$\int_0^2 |x(x- a)|dx= \int_0^a (ax- x^2) dx+ \int_a^2 (ax^2- ax) dx$$

Can you do that?

12. Jun 20, 2013

### Asla

I did not get it it gives me something completely different as the answer.Do you know of some material that could guide me on how to integrate functions with absolute values?

13. Jun 20, 2013

### Curious3141

Fixed error.

14. Jun 20, 2013

### haruspex

You have been shown how to do it: you must break the integration range so that, within each range you can replace the absolute value expression with an expression of the appropriate sign. E.g. Integral -1 to +1 of |x| becomes integral -1 to 0 of -x (a positive quantity) plus the integral from 0 to 1 of +x. The problem is that in this thread you have made mistakes in doing that.