# Calculating Constants in indefinite integral with 2 values for f.

1. Sep 9, 2012

### tainted

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

Find the function f(x) such that $f''(x) = \frac{1}{x^2}$, $f(1) = 0$ and $f(e) = 0$

2. Relevant equations
$\int f''(x)\,dx = f'(x) + c$
$\int f'(x)\,dx = f(x) + cx + C$

3. The attempt at a solution
$f''(x)= \frac{1}{x^2}$
$f'(x)= \int \frac{1}{x^2}\,dx = \frac{-1}{x} + c$
$f(x) = -\int \frac{1}{x} + c\,dx = -ln(x) + cx + C$

My problem is that I can get the constants to satisfy one of those requirements in the original problem, but I am having trouble getting it to satisfy both.

Last edited: Sep 9, 2012
2. Sep 9, 2012

### Muphrid

Show some work? Might be able to find the issue. With only two data points and two constants, there shouldn't be any big issue setting both.

3. Sep 9, 2012

### tainted

That is my work. That's what I've had for over an hour /facepalm
I've tried guessing some constants, but nothing has worked. I don't know how to get the constants to fit both those statements
$f(1) = 0$ and $f(e) = 0$

4. Sep 9, 2012

### Muphrid

All right then. What are $f(1),f(e)$ in terms of these constants?

5. Sep 9, 2012

### tainted

I really have no clue. In terms of what constants? I haven't seen anything like this problem before. I have seen plenty where $f'(e)=0$ and $f(1) = 0$or the likes, but I haven't seen them where both value were just for $f$

Last edited: Sep 9, 2012
6. Sep 9, 2012

### Muphrid

itex, not itext.

In terms of the constants $c, C$. You wrote $f(x)$ in the first post. Even though you don't know the values of $c,C$, you should be able to evaluate the function and get an expression in terms of these constants at $x=1,e$.

7. Sep 9, 2012

### tainted

Alright thanks. I think that got me going in the right direction.

$f(x) = -ln(x) + cx + C$
$f(1) =-ln(1) + 1*c + C = 0$
$f(e) = -ln(e) + e*c + C = 0$
$-ln(1) + 1*c + C = -ln(e) + e*c + C$
$-0 + c + C = -1 + e*c + C$
$-0 + c + C = -1 + e*c + C$
$c = e*c - 1$
$c + 1 = e*c$
$1 = e*c - c$
$1 = c(e-1)$
$\frac{1}{e-1} = c$

Does that look correct on evaluating for $c$ ?

Last edited: Sep 9, 2012
8. Sep 9, 2012

### Muphrid

Yeah, I think that's correct. You should be able to substitute in and find $C$ at this point. In general, as you can see, if you have an Nth order differential equation, you only need N pieces of information in order to determine all the integration constants. They can be values of derivatives or values of the function itself at any arbitrary points.

9. Sep 9, 2012

### tainted

Using that value for $c$, I did the following.

$f(x) = -ln(x) + \frac{1}{e-1} * x + C$
$f(x) = -ln(x) + \frac{x}{e-1} + C$
$f(1) = -ln(1) + \frac{1}{e-1} + C = 0$
$f(1) = -0 + \frac{1}{e-1} + C = 0$
$C = \frac{-1}{e-1}$

That would make my final answer

$f(x) = -ln(x) + \frac{x}{e-1} - \frac{1}{e-1}$

I tested it, and it appeared to work

Thanks a lot man. At first I was trying to figure out what you meant, but once I did, I was able to get it. I hadn't realized that you could have only 2 values of the function to determine both the constants
Thank you

10. Sep 9, 2012

### Muphrid

Yeah, you just end up with two equations, two unknowns in a linear system. It's a piece of cake once you've seen it once or twice. Just making the leap to getting there is the only hard part.