# Homework Help: Calculus I - Line and extrema problem

1. Jan 12, 2012

### Kaldanis

Hi again, my calculus exam is on monday so trying hard to understand the things I'm struggling with. I think I'm almost there with part a - well I can solve it through drawing a graph or using a graphing program - but I'd rather solve it without graphs if possible. Part b however is causing me a lot of problems! Thanks in advance for any help

(a) Let Q be the point in the x-y-plane with coordinates (2,−1) and let L be the line given by the equation y = ½x+3.
Find the coordinates of the point P on the line L such that the distance between P and Q is minimal. Calculate this distance.​

My attempt
The shortest line will be a straight perpendicular line, meaning the two gradients must multiply to give -1. I already know the first m=½, so the for the second line m=-2. Using m=-2, x=2 and y=-1 in the line equation, I get y=-2x+3. So now I have the equations of the two lines that are perpendicular to each other... but how do I work out the point at which they intersect? When graphing it I'm able to see visually straight away and then work out the distance, but I want to be able to do it without using a graphing program. Is there a way to work out the intersection point mathmatically?

(b) Let g be the function on the interval [−3, 5] defined by $$g(x) = \begin{cases} x^{3}+4 & \text{ if } -3 \le x \le -1 \\ -x^{2}-5x-1 & \text{ if } -1 < x \le 5 \end{cases}$$Determine whether g is continuous and whether g is differentiable on [−3, 5], determine the absolute maxima and minima of g on the interval [−3, 5], and determine the corresponding maximal and minimal values of g.​

My attempt
Problems like this are giving me the most problems. For the function to be continuous it just has to be defined everywhere, or basically it has to be able to be drawn without taking the pen off the paper. So the function is indeed continuous? To work out if it's differentiable, well I can differentiate both of the equations but I don't think it's as easy as that? Then to find extrema I set the derivative equal to zero and see when this happens?

2. Jan 12, 2012

### Mentallic

I get a different equation. Remember that the point-gradient formula for a line is

$$y-y_1=m(x-x_1)$$

and from what I can tell, you accidentally added x1 instead of subtracting.

Two lines intersecting means they meet at a point, correct? Thus their x and y values are equal. Do you know how to solve two equations simultaneously?

You can have a function that is defined everywhere but isn't continuous. If you start drawing the function with your pencil from x=0 up to say, x=2. At this point you find yourself at the point (2,0) but then decide to jump up to (2,3) before continuing. This can be a function, but it isn't continuous because you've jumped.
So what does this mean? All it's saying is that for the piecewise graph to be a function, each ends of the domain that connect must be equal in value. In your case, the value of x=-1 (the point where each function separates) must have the same y-value for each function.

For differentiability, you need continuity. So once you find out if it's continuous or not, you will know whether to start checking if it's differentiable.
To know if it's differentiable, you need to take the derivative of each function and then at the point where the domains separate (x=-1 in your case) the derivatives must be equal at this point. If the piecewise graph is continuous then that means you can draw the function without lifting your pen off the paper as you said, but if it's not differentiable then it means at x=-1 you will have a sharp point, not a smooth function.

Not only that, but you need to check the endpoints of the graph too. Think about the function y=x3 for x between -2 and 2, if you take the derivative you'll find it's equal to zero at x=0 (thus there is a turning point there) but it doesn't mean this is the maxima or minima of the function.

3. Jan 12, 2012

### SammyS

Staff Emeritus
For part (a), I also get y = -2x + 3, for the equation of the line perpendicular to L, passing through (2, -1).

How do you solve two equations in two unknowns?

4. Jan 12, 2012

### Kaldanis

Mentallic, thank you very much for the detailed explanation. I checked the equation to part (a) over and over and I still get y = -2x+3, but I think SammyS confirmed that he got the same. I didn't think to solve them simultaneously... damn. I knew how to do that but for some reason it just completely slipped my mind. Doing that I get the coords (0,3), which agrees with what I saw when I graphed it. So thanks to both of you for that part.

For part (b), following what you said, it is definitely continuous since putting the joining point of -1 into both equations gives the y value of 3. Now that I know it's continuous I can check differentiability. When putting -1 into both derivatives I get 3 for the first and -3 for the second. This means that there is a sharp turning point in the function and it's not "smooth", so it is not differentiable?

5. Jan 12, 2012

### Mentallic

Yes that was my mistake. Looking back at the equations I wrote myself, I accidentally used m=2.

You can also check if that point (0,3) is right by plugging it into both equations. It should satisfy both equations.

Yes, exactly

Now there is one more thing to realize since you're dealing with a function that isn't differentiable everywhere when finding the maxima and minima. At this sharp point, it is neither a turning point, nor either end of the domain of the piecewise function, but it still has the possibility of being a maxima or minima. So you need to consider its y-value of 3 as well.

6. Jan 13, 2012

### Kaldanis

I really wish the professor explained it like this when teaching it in the lecture. Been doing it for weeks and it made little sense, then you cleared it up in one post. :)

7. Jan 13, 2012

### Mentallic

I myself haven't tried teaching, but I can imagine it would be harder to get your point across when your class is mixed with students having a wide range of abilities.
But nonetheless, I'll take that compliment! Thanks and it was a pleasure helping you out