# Understanding limits

#### Rido12

##### Well-known member
MHB Math Helper
I know this is probably a dumb question, but I have a question regarding this. My textbook says the following: "A function f is differentiable at a if f'(a) exists."

It then follows with and example regarding if f(x) = |x| is differentiable at x = 0. They prove this by finding the limit of its derivative, and then splits it in two equations: for the limit as h -> 0+ and h -> 0-. Finally concluding that it is not differentiable as the limits are different. Done.

My question is as follows: does the method, as demonstrated above, work for all functions when you're trying to find if a certain point is differentiable? I question it because even if the aforementioned limit DOES exist, it doesn't mean that f'(a) exists. It just means that it has a limit, as you can have a limit of something when f'(a) is undefined. Thus, making the method inadequate to making such a conclusion.

EDIT:
Sorry if this is confusing, and if you want me to clarify, I can provide a hypothetical situation.
Ok, time to clarify what I'm trying to convey with a hypothetical situation (not real)

We are asked to see if f(x) = |x| is differentiable at x = 0. Let's PRETEND that the limit exists at f'(a). That when you took the limit from the positive and negative side of it, it resulted in 5. However, it is actually undefined at 5, but the limit as you approach f'(a) is 5. By using the same logic as above, the logic that the textbook example used, we are to assume that YES, It is differentiable, BECAUSE the limit exists! However, that is actually NOT the case, since the by the definition, f'(a) MUST exists. But in this example, YES, the limit exists, but f'(a) doesn't exist as it is undefined at a.

That being said, would additional steps be taken/required, in order to prove if something is or is not differentiable. As we see in my hypothetical situation, just determining the limit was not enough.

Last edited:

#### Bacterius

##### Well-known member
MHB Math Helper
[JUSTIFY]Okay, this is hurting my brain so I'll conservatively assert that:

1. If the two limits are the same, you are correct that this says absolutely nothing about the existence of the derivative at $x = a$, so if the limits are the same this is as far as this method will take you.

2. If the two limits are different, then for most well-behaved functions the derivative does not exist at that point, however there are may exist crazy analytical functions which are continuous while their derivative isn't, and vice versa, so it may not be a sufficient condition to show the existence of $f'(a)$.[/JUSTIFY]

Last edited:

#### Jameson

Staff member
This is a really good question.

[Rest of post deleted due to a mistake. Updated thought can be found in my later post]

#### caffeinemachine

##### Well-known member
MHB Math Scholar
Hey Jameson! I think what you said is not entirely correct.

This is a really good question.

In order for a function of one variable, $f(x)$, to be differentiable at a point $a$, then it must be be continuous at $a$ and the following limit must exist ...
I think the thing in bold is redundant. The continuity of $f$ at $a$ follows from the differentiability of $f$ at $a$.

2) Just knowing that the above limit exists is not enough to say that $f(x)$ is differentiable at $a$. ...
I think knowing that the limit exists equivalent to $f$ being differentiable at $a$. That is by definition of differentiability at a point. Moreover, strictly, we should not say that $f(x)$ is differentiable at $a$ but simply say that $f$ is differentiable at $a$.

Please correct me if I am wrong or if I have misinterpretted your response.

#### caffeinemachine

##### Well-known member
MHB Math Scholar
I know this is probably a dumb question
This is not a dumb question at all.

My textbook says the following: "A function f is differentiable at a if f'(a) exists."
It then follows with and example regarding if f(x) = |x| is differentiable at x = 0. They prove this by finding the limit of its derivative, and then splits it in two equations: for the limit as h -> 0+ and h -> 0-. Finally concluding that it is not differentiable as the limits are different. Done.

My question is as follows: does the method, as demonstrated above, work for all functions when you're trying to find if a certain point is differentiable? I question it because even if the aforementioned limit DOES exist, it doesn't mean that f'(a) exists. It just means that it has a limit, as you can have a limit of something when f'(a) is undefined. Thus, making the method inadequate to making such a conclusion.
I think you are making mistakes here. We write $$f'(a)=\lim_{x\to a}\frac{f(x)-f(a)}{x-a}$$ whether the limit exists or doesn't exist. When the limit doesn't exist, $f'(a)$ is not defined. When the limit $\lim_{x\to a}\frac{f(x)-f(a)}{t-a}$ exists, then $f'(a)$ is same as this limit. So $f'(a)$ is a real number and certainly it exists.

Note that when $\lim_{x\to a}\frac{f(x)-f(a)}{t-a}$ exists then this doesn't say that $f'(a)$ has a limit. This would have no meaning. It says that $\frac{f(x)-f(a)}{x-a}$ has a limit as $x$ approaches $a$. For a short hand notation, and for furthering the theory, we denote this limit, whether it exists or not, as $f'(a)$.

I have not read the content in Spoiler box thoroughly yet. Tell me if you have further doubts or you need to discuss.

EDIT: I have implicitly assumed that $f$ is a real function having an interval $I$ in its domain such that $a\in I$.

Last edited:

#### Bacterius

##### Well-known member
MHB Math Helper
He is taking the limit of the derivative, not the original function itself.

#### Jameson

Staff member
Hey Jameson! I think what you said is not entirely correct.
Yep, I think I need to edit a couple of things.

I think the thing in bold is redundant. The continuity of $f$ at $a$ follows from the differentiability of $f$ at $a$.
Yes I agree that continuity is a necessary condition of differentiability thus differentiability implies continuity, but the converse is not true. That's what I meant.

I think knowing that the limit exists equivalent to $f$ being differentiable at $a$. That is by definition of differentiability at a point. Moreover, strictly, we should not say that $f(x)$ is differentiable at $a$ but simply say that $f$ is differentiable at $a$.

Please correct me if I am wrong or if I have misinterpreted your response.
About the part in bold - yes I agree with you and would normally write that but thought the OP might be used to seeing functions always written in the form "$f(x)$" so wrote it that way. You're right of course.

Now that I think about it more the if the limit exists then it will be continuous. I was thinking of a situation like $f(x)=\frac{x^2-4}{x-2}$ at $x=2$ where the derivative appears to exist by the limit definition but isn't continuous. However now I see that this won't have a limit for the limit definition of a derivative so the extra stipulation of being continuous isn't necessary as it's already implied by the existence of the limit definition of a derivative.

I suppose the main idea I'm expressing is differentiability implies continuity but the opposite is not true.

#### Jameson

Staff member
He is taking the limit of the derivative, not the original function itself.
Are you sure? I think caffeinemachine addressed his terminology in a way that makes sense. It looks to me like the we're talking about the limit definitions of functions.

#### caffeinemachine

##### Well-known member
MHB Math Scholar
He is taking the limit of the derivative, not the original function itself.
Umm.. now I am totally confused. If you understand his doubt then can you please frame it nicely and post it along with your solution?

#### Bacterius

##### Well-known member
MHB Math Helper
Are you sure? I think caffeinemachine addressed his terminology in a way that makes sense. It looks to me like the we're talking about the limit definitions of functions.
That was my first interpretation as well. But after rereading his example it actually seems that he is talking about taking the two-sided limit of the derivative of $f$ to establish whether the derivative exists at a given point (so the question would become: is the derivative being (non-)continuous at $x = a$ a sufficient condition for the (non-)existence of the derivative at $x = a$?)

At least that's my take on it. I figured the question was deeper than just "being continuous is necessary but not sufficient for differentiability". But it's possible I am just talking nonsense here haven't done any formal calculus in a while.

#### Rido12

##### Well-known member
MHB Math Helper
I haven't read all your responses yet, but it is the limit of the derivatvive. I don't knwo anymore haha, I'm too confused.

The textbook does this:

f'(x) = lim h-> 0 (|0 + h| - |0|)/ h
Then split in two parts to compute the left and right limits separetely.

#### Jameson

Staff member
I'm pretty sure you don't mean "the limit of the derivative" but the "limit definition of the derivative". Your example seems to confirm this.

#### Rido12

##### Well-known member
MHB Math Helper
Yep, I think I need to edit a couple of things.

Yes I agree that continuity is a necessary condition of differentiability thus differentiability implies continuity, but the converse is not true. That's what I meant.

About the part in bold - yes I agree with you and would normally write that but thought the OP might be used to seeing functions always written in the form "$f(x)$" so wrote it that way. You're right of course.

Now that I think about it more the if the limit exists then it will be continuous. I was thinking of a situation like $f(x)=\frac{x^2-4}{x-2}$ at $x=2$ where the derivative appears to exist by the limit definition but isn't continuous. However now I see that this won't have a limit for the limit definition of a derivative so the extra stipulation of being continuous isn't necessary as it's already implied by the existence of the limit definition of a derivative.

I suppose the main idea I'm expressing is differentiability implies continuity but the opposite is not true.
It's quite strange actually. I always do see functions written in teh form "f(x)" rather than just "f"... My textbook uses "f", so now I do that too. But my previous math teachers use "f(x)"

- - - Updated - - -

I'm pretty sure you don't mean "the limit of the derivative" but the "limit definition of a derivative". Your example seems to confirm this.
I'm confused. OH. My example was just finding the derivative of a function right, by taking its limit right? I got confused because I don't usually see the word "limit" when I take derivatives using power rule, chain, etc, and I got mixed up thinking it was the limit of a derivative.

And I haven't finished reading the responses yet from the previous page.

#### Rido12

##### Well-known member
MHB Math Helper
That was my first interpretation as well. But after rereading his example it actually seems that he is talking about taking the two-sided limit of the derivative of $f$ to establish whether the derivative exists at a given point (so the question would become: is the derivative being (non-)continuous at $x = a$ a sufficient condition for the (non-)existence of the derivative at $x = a$?)

At least that's my take on it. I figured the question was deeper than just "being continuous is necessary but not sufficient for differentiability". But it's possible I am just talking nonsense here haven't done any formal calculus in a while.
This is precisely what I meant with my question; I don't know if that is the limit definition of derivatives, or whatnot. Now if only my original post was as concise as how you explained it

EDIT: second thought, brain hurts, not sure if that's how i meant it but:
It's just that I'm not convinced that f'(a) exists by just taking its limit from both sides. And it must exist for it to be differentiable at that point.

This:
1. If the two limits are the same, you are correct that this says absolutely nothing about the existence of the derivative at $x = a$, so if the limits are the same this is as far as this method will take you.
I think the notation is confusing me; the limit definition of derivatives has both "f'(x)" and "lim" so it makes me want to think that it's taking the LIMIT of the DERIVATIVE, but now that I think about it, it's simply just taking the derivative.

Last edited:

#### Rido12

##### Well-known member
MHB Math Helper
This leads me to the following question:

When would it be necessary to use the limit definition of a derivative, and when to just solve for the derivative using chain/product, etc rule? It is to my understanding that the limit definition was used to derive the rules mentioned before.

Isn't the limit definition of a derivative the same as finding the derivative and then apply the limit? So the limit of the derivative?

For example, finding the limit (if there is) for f(x) = |x|using the limit definition of a derivative
We compute the two side limit and we get:
f'(x)=lim as h >0+ |x|= |h|/h = 1
f'(x)=lim as h ->0- |x|= |h|/h = -1

Instead, wouldn't it be possible to find the derivative first, then apply the limit?
So: d/dx[|x|] = (skipping steps) 2x / 2|x|= x / |x|
Hence, apply limit as h >0+ x / |x|
= x / x = 1
limit as h >0- x / |x|
= x / -x = -1

#### Bacterius

##### Well-known member
MHB Math Helper
This leads me to the following question:

When would it be necessary to use the limit definition of a derivative, and when to just solve for the derivative using chain/product, etc rule? It is to my understanding that the limit definition was used to derive the rules mentioned before.

Isn't the limit definition of a derivative the same as finding the derivative and then apply the limit? So the limit of the derivative?

For example, finding the limit (if there is) for f(x) = |x|using the limit definition of a derivative
We compute the two side limit and we get:
f'(x)=lim as h >0+ |x|= |h|/h = 1
f'(x)=lim as h ->0- |x|= |h|/h = -1

Instead, wouldn't it be possible to find the derivative first, then apply the limit?
So: d/dx[|x|] = (skipping steps) 2x / 2|x|= x / |x|
Hence, apply limit as h >0+ x / |x|
= x / x = 1
limit as h >0- x / |x|
= x / -x = -1

If you already have an expression for the derivative then you don't need to use the limit definition. You can just evaluate it directly (which you did, since you did not use "h" at all)

I am not sure what you mean though - what would be the purpose of calculating such a limit?

The chain, product rules etc.. can all be derived from the limit definition. They are just much more convenient to use, because calculating derivatives from the limit form (the so-called "first principles") gets rather tedious for anything bigger than a quadratic. The idea is that the limit definition gives the most "basic" definition of what a derivative is, which is important in mathematics (where something without a proper definition is useless).

Last edited:

#### Rido12

##### Well-known member
MHB Math Helper
If you already have an expression for the derivative then you don't need to use the limit definition. You can just evaluate it directly (which you did, since you did not use "h" at all)

I am not sure what you mean though - what would be the purpose of calculating such a limit?

The chain, product rules etc.. can all be derived from the limit definition. They are just much more convenient to use, because deriving from the limit form (the so-called "first principles") gets rather tedious for anything bigger than a quadratic.
Do you also mean to imply that finding the limit here is redundant?

Instead, wouldn't it be possible to find the derivative first, then apply the limit?
So: d/dx[|x|] = (skipping steps) 2x / 2|x|= x / |x|
Hence, apply limit as h >0+ x / |x|
= x / x = 1
limit as h >0- x / |x|
= x / -x = -1
So we could use direct substitution instead of finding the limit, meaning that once we get f'(x) = x / |x| we can do f'(0) = 0/ 0 , meaning that it is not possible to differentiate at x= 0? (Instead of doing all the two side limit hassle that was only necessary when utilizing the limit definition of a derivative)

#### Bacterius

##### Well-known member
MHB Math Helper
Do you also mean to imply that finding the limit here is redundant?

So we could use direct substitution instead of finding the limit, meaning that once we get f'(x) = x / |x| we can do f'(0) = 0/ 0 , meaning that it is not possible to differentiate at x= 0?
Well the same holds true for the function itself. Before differentiating your function you should rigorously show that it is in fact continuous at the locations you want to differentiate it at, otherwise the function is not differentiable there and you cannot even bring up the concept of derivative (it is meaningless). In this case, our function $f(x) = |x| / x$ has a discontinuity at $x = 0$ (you can rigorously show that by taking the left and right limits of the function around that point and demonstrating that $\lim_{x \to 0} f(x)$ does not exist as they are not the same ($-1$ and $+1$ respectively).

Once you know that your function is continuous at that point, then you may try to differentiate it. But that won't necessarily mean the derivative exists! Consider $g(x) = |x|$, it is continuous at $x = 0$ (left and right limits are the same) but it is not differentiable at $x = 0$.

You need to be very careful when differentiating. Just because you get a nice expression for your derivative everywhere except at, say, $x = 0$, does not mean that expression is valid for $x = 0$! This is why it's important to keep track of the domain of each function you are working with. If you find that your derivative is valid for all $x \neq 0$, then that's it - end of story. It is meaningless to plug $x = 0$ into it, the results are undefined because the derivative doesn't apply at that point.

Also, limits don't have much to do with derivatives in the grand scheme of things, but they provide a useful framework on top of which to build the concept of derivative and differentiability (as well as a lot of other important stuff). Don't associate them with limits too much.

Here the "left and right limits" are used to show that the two-sided limit exists, and additionally show continuity. The limit expression of the derivative is different and has a geometrical interpretation, which is basically "take two points on a curve and draw a line between them, as the points get closer and closer together that line starts to approximate a tangent to the curve, which happens to also give the rate of change of the height of the curve with horizontal distance and lots of other useful things".

Last edited:

#### Rido12

##### Well-known member
MHB Math Helper
Once you know that your function is continuous at that point, then you may try to differentiate it. But that won't necessarily mean the derivative exists! Consider $g(x) = |x|$, it is continuous at $x = 0$ (left and right limits are the same) but it is not differentiable at $x = 0$.
Thanks! So I guess the last question is how would I prove that g(x) is not differentiable at x = 0. Say you prove that g(x) is continuous at 0. How would I prove that it is not differentiable at x = 0 .

#### Jameson

Staff member
You already showed that the left and right hand limits at $x=0$ are 1 and -1, which is all you need to do. That shows that the limit doesn't exist thus $g$ is not differentiable at $x=0$. Once again, differentiability implies continuity but continuity does not imply differentiability.

#### Rido12

##### Well-known member
MHB Math Helper
So Step 1 is to see to determine its continuity, if the function is continuous, we can proceed to find the derivative.
Step 2, we find the limit of both sides of the derivative at the point we want to prove, say x = 0 , and we find that the limit doesn't exist
Step 3, we can make a conclusion that because the limit doesn't exist, g'(x) is discontious at the point and impossible to differentiate. for a function to be differentiable, it must be continuous, but the converse is not true.

Is there anythign wrong with the procedure above?

#### Bacterius

##### Well-known member
MHB Math Helper
Thanks! So I guess the last question is how would I prove that g(x) is not differentiable at x = 0. Say you prove that g(x) is continuous at 0. How would I prove that it is not differentiable at x = 0 .
You take the definition of "differentiable":

A function $f(x)$ on $\mathbb{R}$ is differentiable at $x = a$ if and only if $f'(a)$ exists.
From that definition you can choose different approaches depending on your function. For instance, take $f(x) = |x|$. Then, assume $x < 0$, where the function is (probably) differentiable - we'll prove it is shortly. Now apply the definition of the derivative:

$$f'(x) = \lim_{h \to 0} \frac{f(x + h) - f(x)}{h}$$

And we get:

$$f'(x) = \lim_{h \to 0} \frac{|x + h| - |x|}{h}$$

Now because $x < 0$, $|x| = -x$, and we can rewrite this as:

$$f'(x) = \lim_{h \to 0} \frac{|x + h| + x}{h}$$

Now assume $x + h > 0$. But this means that $h > -x$, and since $x$ is negative then $-x$ is positive so $h$ is greater than some non-zero value.. which is a contradiction since we assumed that $h \to 0$. Therefore $x + h < 0$, so $|x + h| = - (x + h) = -x - h$ and:

$$f'(x) = \lim_{h \to 0} \frac{-x - h + x}{h} = \lim_{h \to 0} \frac{-h}{h} = -1 ~ ~ ~ \text{for} ~ ~ x < 0$$

A similar reasoning for $x > 0$ leads to:

$$f'(x) = +1 ~ ~ ~ \text{for} ~ ~ x > 0$$

So we have:

$$f'(x) = \begin{cases} +1 ~ ~ &\text{for} ~ ~ x > 0 \\ -1 ~ ~ &\text{for} ~ ~ x < 0 \end{cases}$$

What now? Well now the left and right limits around $x = 0$ are easy (note we are never actually touching zero, $f'(x)$ has not been defined at that point) and we clearly see that:

$$\lim_{x \to 0^{-}} f'(x) \ne \lim_{x \to 0^{+}} f'(x)$$

And we may conclude that:

$$\lim_{x \to 0} f'(x) ~ ~ ~ \text{does not exist} ~ ~ ~ \implies ~ ~ ~ f'(0) ~ ~ ~ \text{does not exist}$$

And therefore by the definition of differentiability, $f(x)$ is not differentiable at $x = 0$.

That was the semi-rigorous, long-winded way. In practice you use things like the chain rule and various limit/derivative theorems (or even plain observation) to help you simplify the function instead of starting from scratch each time.

For instance, using the result above, you now know that $f(x) = |x|$ is not differentiable at $x = 0$. From that point on you can easily show that $f(x) = |x - a|$ is not differentiable at $x = a$, for all $a \in \mathbb{R}$, and you can now use that fact to find other, more complicated derivatives involving absolute values, using the chain rule, product rule, and so on.

#### Jameson

Staff member
So Step 1 is to see to determine its continuity, if the function is continuous, we can proceed to find the derivative.
Step 2, we find the limit of both sides of the derivative at the point we want to prove, say x = 0 , and we find that the limit doesn't exist
Step 3, we can make a conclusion that because the limit doesn't exist, g'(x) is discontinuous at the point and impossible to differentiate. for a function to be differentiable, it must be continuous, but the converse is not true.

Is there anything wrong with the procedure above?
I hope someone who is more versed in analysis stops by to comment on this, but I will add what I can.

1) Yes, this is a good start. There are other things to consider as well, such a bend, cusp or vertical tangent - but your step #2 will sort those out anyway. You'll develop an eye for noticing these things quickly.

2) It's always a good idea to be able to use the limit definition of a derivative (left and right hand limits as you said) but of course in practice you have quicker ways of calculating derivatives, as you know. You can probably tell from the problem if the goal is to quickly calculate the derivative and use that as part of a greater problem, or if the differentiability itself is the main focus of the problem. Anyway, this step is ok.

3) If the limit doesn't exist, it doesn't automatically follow that the function is not continuous at that point. $f(x)=|x|$ is a great example of this. It is continuous at $x=0$ but not differentiable.

The only thing that I am not certain of is whether step 1 is implied by step 2. Last night I thought there could be an example of a function and a point where the limit definition of a derivative results in an answer for that point but the function was actually discontinuous at the point, so the derivative there couldn't exist. However, I'm not able to come up with an example of this and doubt that it's possible now. If anyone could that would be interesting.

Put another way, if we have a function of one real variable, $f$, can the limit following limit exist if the point, $a$ is not in the domain of $f$?

$$\displaystyle \lim_{h \to 0} \frac{f(a + h) - f(a)}{h}$$

I think not because $f(a)$ is not defined. So that leads me to say that step 2 implies step 1.

#### Rido12

##### Well-known member
MHB Math Helper
Last night I thought there could be an example of a function and a point where the limit definition of a derivative results in an answer for that point but the function was actually discontinuous at the point, so the derivative there couldn't exist. However, I'm not able to come up with an example of this and doubt that it's possible now. If anyone could that would be interesting.
This problem was what compelled me to start this thread in the first place. It occurred to me "what if the limit definition of a derivative results in an answer, but that point was actually discontinuous". I'm also interested if there such as a function as well, as it will clear my problems haha. I agree with you on the premise that step 2 implies step 1.

Thanks guys for the help!

Last edited:

#### MarkFL

$$\displaystyle f(x)=\frac{x}{|x|}$$
It has a jump discontinuity at $x=0$, however, we find:
$$\displaystyle \lim_{h\to0^{-}}\frac{f(x+h)-f(x)}{h}=0=\lim_{h\to0^{+}}\frac{f(x+h)-f(x)}{h}$$


# Why on average does each bootstrap sample contain roughly two thirds of observations?

I have run across the assertion that each bootstrap sample (or bagged tree) will contain on average approximately $2/3$ of the observations.

I understand that the chance of not being selected in any of $n$ draws from $n$ samples with replacement is $(1- 1/n)^n$, which works out to approximately $1/3$ chance of not being selected.

What is a mathematical explanation for why this formula always gives $\approx 1/3$ ?

-
I believe this is the origin of the $.632$ in the bootstrap 632+ rule. –  gung Mar 6 at 2:46

Essentially, the issue is to show that $\lim_{n\to\infty}(1- 1/n)^n=e^{-1}$
(and of course, $e^{-1} =1/e \approx 1/3$, at least very roughly).

It doesn't work at very small $n$ -- e.g. at $n=2$, $(1- 1/n)^n=\frac{1}{4}$. It passes $\frac{1}{3}$ at $n=6$, passes $0.35$ at $n=11$, and $0.366$ by $n=99$. Once you go beyond $n=11$, $\frac{1}{e}$ is a better approximation than $\frac{1}{3}$.

The grey dashed line is at $\frac{1}{3}$; the red and grey line is at $\frac{1}{e}$.

Rather than show a formal derivation (which can easily be found), I'm going to give an outline (that is an intuitive, handwavy argument) of why a (slightly) more general result holds:

$$e^x = \lim_{n\to \infty} \left(1 + x/n \right)^n$$

(Many people take this to be the definition of $\exp(x)$, but you can prove it from simpler results such as defining $e$ as $\lim_{n\to \infty} \left(1 + 1/n \right)^n$.)

Fact 1: $\exp(x/n)^n=\exp(x)\quad$ This follows from basic results about powers and exponentiation

Fact 2: When $n$ is large, $\exp(x/n) \approx 1+x/n\quad$ This follows from the series expansion for $e^x$.

(I can give fuller arguments for each of these but I assume you already know them)

Substitute (2) in (1). Done. (For this to work as a more formal argument would take some work, because you'd have to show that the remaining terms in Fact 2 don't become large enough to cause a problem when taken to the power $n$. But this is intuition rather than formal proof.)

[Alternatively, just take the Taylor series for $\exp(x/n)$ to first order. A second easy approach is to take the binomial expansion of $\left(1 + x/n \right) ^n$ and take the limit term-by-term, showing it gives the terms in the series for $\exp(x/n)$.]

So if $e^x = \lim_{n\to \infty} \left(1 + x/n \right) ^n$, just substitute $x=-1$.

Immediately, we have the result at the top of this answer, $\lim_{n\to\infty}(1- 1/n)^n=e^{-1}$

As gung points out in comments, the result in your question is the origin of the 632 bootstrap rule

e.g. see

Efron, B. and R. Tibshirani (1997),
"Improvements on Cross-Validation: The .632+ Bootstrap Method,"
Journal of the American Statistical Association Vol. 92, No. 438. (Jun), pp. 548-560

-

More precisely, each bootstrap sample (or bagged tree) will contain $1-\frac{1}{e} \approx 0.632$ of the sample.

Let's go over how the bootstrap works. We have an original sample $x_1, x_2, \ldots x_n$ with $n$ items in it. We draw items with replacement from this original set until we have another set of size $n$.

From that, it follows that the probability of choosing any one item (say, $x_1$) on the first draw is $\frac{1}{n}$. Therefore, the probability of not choosing that item is $1 - \frac{1}{n}$. That's just for the first draw; there are a total of $n$ draws, all of which are independent, so the probability of never choosing this item on any of the draws is $(1-\frac{1}{n})^n$.

Now, let's think about what happens when $n$ gets larger and larger. We can take the limit as $n$ goes towards infinity, using the usual calculus tricks (or Wolfram Alpha): $$\lim_{n \rightarrow \infty} \big(1-\frac{1}{n}\big)^n = \frac{1}{e} \approx 0.368$$

That's the probability of an item not being chosen. Subtract it from one to find the probability of the item being chosen, which gives you 0.632.

-

Sampling with replacement can be modeled as a sequence of binomial trials where "success" is an instance being selected. For an original dataset of $n$ instances, the probability of "success" is $1/n$, and the probability of "failure" is $(n-1)/n$. For a sample size of $b$, the odds of selecting an instance exactly $x$ times is given by the binomial distribution:

$$P(x,b,n) = \bigl(\frac{1}{n}\bigr)^{x} \bigl(\frac{n-1}{n}\bigr)^{b-x} {b \choose x}$$

In the specific case of a bootstrap sample, the sample size $b$ equals the number of instances $n$. Letting $n$ approach infinity, we get:

$$\lim_{n \rightarrow \infty} \bigl(\frac{1}{n}\bigr)^{x} \bigl(\frac{n-1}{n}\bigr)^{n-x} {n \choose x} = \frac{1}{ex!}$$

If our original dataset is big, we can use this formula to compute the probability that an instance is selected exactly $x$ times in a bootstrap sample. For $x = 0$, the probability is $1/e$, or roughly $0.368$. The probability of an instance being sampled at least once is thus $1 - 0.368 = 0.632$.

Needless to say, I painstakingly derived this using pen and paper, and did not even consider using Wolfram Alpha.

-

This can be easily seen by counting. How many total possible samples? n^n. How many NOT containing a specific value? (n-1)^n. Probability of a sample not having a specific value - (1-1/n)^n, which is about 1/3 in the limit.

-


# Is it OK to evaluate improper integrals this way?

Today in class we learned that when you have an improper integral like this one:

$$\int_{-\infty}^\infty {f(x)} \: dx$$

you must split it before you do the limits (like so):

$$\lim_{a \to \infty} \int_{-a}^n {f(x)} \: dx + \lim_{a \to \infty} \int_{n}^a {f(x)} \: dx$$

I asked if this would work:

$$\lim_{a \to \infty} \int_{-a}^a {f(x)} \: dx$$

And my teacher said it wouldn't work, but he wouldn't explain why. Why wouldn't that work? An example of a function that doesn't work would be especially nice.

• – beep-boop Dec 16 '14 at 19:11
• I tried the same thing, and it didn't work in a case. That's what convinced me I couldn't do this – Justin Dec 16 '14 at 22:23

The problem is that limiting to both infinities at the same time can overlook divergence.

However, the value: $\lim\limits_{a \to \infty} \int_{-a}^a f(x)\,dx$ (if it exists) is important enough to have a name: the principal value.

So why can't you just do the limit like this? Consider $\int_{-\infty}^\infty x\,dx$

Notice that $\int_0^\infty x\,dx$ diverges to $\infty$ and $\int_{-\infty}^0 x\,dx$ diverges to $-\infty$. So we get (from either side) that our integral diverges.

However, $\lim\limits_{a \to \infty} \int_{-a}^a x\,dx = \lim\limits_{a \to\infty} a^2/2 - (-a)^2/2 = \lim\limits_{a \to \infty} 0 = 0$.

So the principal value of $\int_{-\infty}^\infty x\,dx$ is zero while the integral itself diverges.

In general, IF an improper integral converges, you can be very sloppy and get the right answer. On the other hand, if it actually diverges, sloppiness can miss this!

As I tell my students: You must approach ONE side of EACH bad spot by itself. Then put your answer together.

Addendum: Suppose $\int_{-\infty}^c f(x)\,dx$ and $\int_c^\infty f(x)\,dx$ exist.

Then $\int_{-\infty}^\infty f(x)\,dx = \lim\limits_{a \to -\infty} \int_a^c f(x)\,dx + \lim\limits_{b \to \infty} \int_c^b f(x)\,dx = \lim\limits_{b \to \infty} \int_{-b}^c f(x)\,dx + \lim\limits_{b \to \infty} \int_c^b f(x)\,dx$

Now because those two limits exist, we can combine them. So we get...

$=\lim\limits_{b \to \infty} \int_{-b}^c f(x)\,dx + \int_c^b f(x)\,dx =\lim\limits_{b \to \infty} \int_{-b}^b f(x)\,dx$

...which is the principal value. So the improper integral and principal value match when the integral actually converges.

• And as further evidence that using $\lim\limits_{a \to \infty} \int_{-a}^a x\,dx$ is wrong, consider that $\lim\limits_{a \to \infty} \int_{-a}^{a+1} x\,dx$ obviously diverges, but there's no reason why we couldn't just as well use that to represent $\int_{-\infty}^\infty x\,dx$. Being more symmetrical doesn't make the first one more right ;-) – Steve Jessop Dec 17 '14 at 9:53
• @SteveJessop Exactly. That's what I tried explain in my answer. – Eff Dec 17 '14 at 11:20

(There is already a good answer, but I thought I'd add something.)

We say that a limit exists, if no matter how we approach it approaches the same. For example $$-1 = \lim_{x\to0^-}\frac{|x|}{x}\neq\lim_{x\to 0^+}\frac{|x|}{x} = 1$$ and hence the limit $\lim_{x\to0}|x|/x$ does not exist. In a similar way, we have to consider any way the interval of integration $[a,b]$ grows, where $a\to-\infty$ and $b\to\infty$.

Consider for example \begin{align} &\int_{-n}^{2n} x\,\mathrm{d}x =\frac{3}{2}n^2 &\text{and }\quad &\int_{-n}^n x\,\mathrm{d}x = 0.\end{align} As $n$ approaches $\infty$ the interval is $[-\infty,\infty]$ for both integrals, but approaching in different ways. In this example we have that the first integral goes to infinity, however the second integral seems to converge? As I said, a limit has to be the same no matter how we approach it, so the integral $$\int_{-\infty}^\infty x\,\mathrm{d}x$$ actually diverges (which it does not using "your" method). I hope this helps you see why it is important to consider the end-points of the interval independently.

The only case in which you can not define the integral that way is when $f$ is not integrable. In terms of the Lebesgue integral you can check this for positive functions.

Wikipedia mentions $$f(x) = \left\{ \begin{array} \;1 \; \; x > 0 \\ -1 \;\;x < 0 \end{array} \right. .$$

You can check that this has $0$ at each term in the sequence $\lim\limits_{a \rightarrow \infty} \int\limits_{-a}^a f(x) dx$, but is clearly not integrable by the definition of the Riemann integral or the Lebesgue integral.

If there is a " discontinuity " at the point "n" , then combining the two integrals , will not (may not) give the correct result.


# Integration Techniques [Solved!]

### My question

You state in Section four that all angles are in radians and that the formulas do not work in degress.

Why do they only work in radians?

### Relevant page

4. Integration: Basic Trigonometric Forms

### What I've done so far

Just wanted to know if there are some integration techniques that work in degrees.

X

You state in Section four that all angles are in radians and that the formulas do not work in degress.

Why do they only work in radians?
Relevant page

4. Integration: Basic Trigonometric Forms

What I've done so far

Just wanted to know if there are some integration techniques that work in degrees.

## Re: Integration Techniques

Radians have the "magical" quality that they can act as angles (amount of turn around a point) or as number quantities (the quality that allows us to use them in calculus).

Degrees, on the other hand, can only be a measure of an angle (or of course, temperature).

Probably the best way to show why degrees don't work in calculus is through an example. We'll look at it from the differentiation point of view.

Consider this graph which shows y=sin(x) using radians (in green) and using degrees (in magenta):

We know the following for the green curve:

d/dx sin(x) = cos(x)

At x=0, the slope is cos(0) = 1

But now consider the slope of the magenta curve (using degrees). It is much less, and in fact it is:

At x=0^@, the slope is pi/180 cos(0^@) = pi/180

So if we wanted to use degrees for calculus, we would have to multiply a lot of our expressions by pi/180 (or similar) and it would get very messy.

In order for the following formula to "work", x needs to be in radians:

d/dx sin(x) = cos(x)

Hope it helps.

X

Radians have the "magical" quality that they can act as angles (amount of turn around a point) or as number quantities (the quality that allows us to use them in calculus).

Degrees, on the other hand, can only be a measure of an angle (or of course, temperature).

Probably the best way to show why degrees don't work in calculus is through an example. We'll look at it from the differentiation point of view.

Consider this graph which shows y=sin(x) using radians (in green) and using degrees (in magenta):

[graph]310,250;-1,10;-1.1,1.1,1.57,1;sin(x),sin(3.14x/180)[/graph]

We know the following for the green curve:

d/dx sin(x) = cos(x)

At x=0, the slope is cos(0) = 1

But now consider the slope of the magenta curve (using degrees). It is much less, and in fact it is:

At x=0^@, the slope is pi/180 cos(0^@) = pi/180

So if we wanted to use degrees for calculus, we would have to multiply a lot of our expressions by pi/180 (or similar) and it would get very messy.

In order for the following formula to "work", x needs to be in radians:

d/dx sin(x) = cos(x)

Hope it helps.

## Re: Integration Techniques

It does. A good example to use. Thank you.

X

It does.  A good example to use.  Thank you.

You need to be logged in to reply.

## Related Methods of Integration questions

• Geometry [Solved!]
Exercise #1 on the url below
• Re: Direct Integration, i.e., Integration without using 'u' substitution [Solved!]
Right, after we differentiated our solutions, we arrived at the original integrands. Which is...
• Integration by Parts [Solved!]
When using IBP, is the rule to simplify v times du FIRST and then integrate...
• Decomposing Fractions [Solved!]
In decomposing the fraction of Chapter 11 Integration example 3 b, we are trying to...
• Partial Fraction [Solved!]
In example 4, the numerator in the next-to-last step is (1/2)x + 1. How did you...

Search IntMath


System of Equation. (Complicated)

Given that $x,y \in \mathbb{R}$. Solve the system of equation.

$$5x(1+\frac{1}{x^2+y^2})=12$$

$$5y(1-\frac{1}{x^2+y^2})=4$$

My attempt, I made them become $x+\frac{x}{x^2+y^2}=\frac{12}{5}$ and $y-\frac{y}{x^2+y^2}=\frac{4}{5}$.

I don't know how to continue from here. Hope anyone would provide some different solutions. Thanks in advance.

• Hint: $\;\frac{12}{5x}+\frac{4}{5y}=\cdots$ – dxiv Mar 26 '17 at 3:01
• Can't you equate through $x^2 + y^2$ term and then isolate x (or y) and then sub back in and solve? – 123 Mar 26 '17 at 3:02

As dxiv has given hint:

$$\frac{12}{5x} + \frac{4}{5y} = 2 \implies x = \frac{6y}{5y-2}$$

Now put this in any one of the relation to make the relation full in terms of $y$.

Multiply equation (1) by y and equation (2) by x,

$$5xy(1+\frac{1}{x^2+y^2})=12y$$

$$5xy(1-\frac{1}{x^2+y^2})=4x$$

$$10xy = 12y + 4x$$

You can find y in terms of x or x in terms of y.

• You can try substitution. May be that is better option. – Kanwaljit Singh Mar 26 '17 at 3:55

Just to provide another way.

Use polar coordinates $$x=\rho \cos(\theta) \qquad y=\rho \sin(\theta)$$ to make the equations to be $$\frac{5 \left(\rho ^2+1\right) \cos (\theta )}{\rho }=12$$ $$\frac{5 \left(\rho ^2-1\right) \sin (\theta )}{\rho }=4$$ So,$$\cos(\theta)=\frac{12 \rho }{5 \left(\rho ^2+1\right)}\qquad \sin(\theta)=\frac{4 \rho }{5 \left(\rho ^2-1\right)}$$ Now, using $$\sin^2(\theta)+\cos^2(\theta)=1 \implies \frac{16 \rho ^2}{25 \left(\rho ^2-1\right)^2}+\frac{144 \rho ^2}{25 \left(\rho ^2+1\right)^2}=1$$ Now, let $t=\rho ^2$ to have $$\frac{16 t}{25 \left(t -1\right)^2}+\frac{144 t}{25 \left(t+1\right)^2}=1$$ Reduce to same denominator to get $$25 t^4-160 t^3+206 t^2-160 t+25=0$$ where you can notice the symmetry of coefficients.

Factoring gives $$25 t^4-160 t^3+206 t^2-160 t+25=(5-t) (5 t-1) \left(5 t^2-6 t+5\right)=0$$ The quadratic does not show real roots; this makes the solutions to be $$t_1=\frac 15\qquad t_2=5$$ then $$\rho_1=\frac 1 {\sqrt 5}\qquad \rho_2=\sqrt 5$$ and now compute the corresponding $\theta$'s from $$\tan(\theta)=\frac{\sin(\theta) }{\cos(\theta) }=\frac{t+1}{3 (t-1)}=-\frac 12$$.

• Up for this answer – Mathxx Mar 26 '17 at 6:09

$$5x(1+\frac{1}{x^2+y^2})=12\cdots \cdots (1)$$

$$5y(1-\frac{1}{x^2+y^2})=4\cdots \cdots \cdots \cdots (2) \times i$$

$$5(x+iy)+5\cdot \frac{x-iy}{(x+iy)(x+iy)}=12+4i$$

put $z=x+iy$ and $\bar{z} = x-iy$ and $|z|^2= z \cdot \bar{z} = x^2+y^2$

So $$5z+\frac{5\bar{z}}{z \cdot \bar{z}}=12+4i$$

So $$5z+\frac{5}{z} = 12+4i$$

So $$5z^2-(12+4i)z+5=0$$ after solving $$z=\frac{12+4i\pm \sqrt{(12+4i)^2-100}}{10} = \frac{12+4i\pm (8+6i)}{10} = 2+i\;,\frac{2-i}{5}$$

So $$z= x+iy = 2+i\;,\frac{2-i}{5}$$

So $$(x,y) = \left\{(2,1)\;\;, \left(\frac{2}{5},-\frac{1}{5}\right)\right\}$$

First of all get rid of $x^2+y^2$

$$\frac{12}{4x} +\frac{4}{5y} = 2,\quad 2x+6y = 5xy$$

It is a rectangular hyperbola passing through origin with asymptotes parallel to axes reminding one of $x= t, y= 1/t$ when axes are asymptotes. So solve for $x,y$

$$x= \frac{6y}{5y-2},\, y= \frac{2x}{5x-6}$$

The asymptotes are

$$x= \frac65 ,\, y= \frac{2}{5}$$

We take hyperbola in the form

$$( x-\frac65 ) (y- \frac25) = k$$

Since it goes through the origin, $k$ must be the product $k=\dfrac65 \cdot \dfrac25 = \dfrac{12}{25}$ so as not to leave behind any constant term.

We can now find $x,y$ upto a parameter $t$

$$( x-\frac65 ) (y- \frac25) = \frac{12}{25}$$

$$\rightarrow x= \frac65 + t \sqrt{12}/5,\, y= \frac25 + \sqrt{12}/{5t},\,$$


# Algebra Question

Hello,

I wanted to confirm that I am understanding something correctly. I have been doing this all the time, and have never had any problems with it. For some reason now I am wanting to confirm it.

So, if you have something such as: x3-6+y2-√z it would be equivalent to write it as: y2+x3-√z-6

Can you always rearrange terms like this, no matter what they are? What I do is write it as an addition problem so I can change the order, since you can change the order in addition.

For example if you have: log(x)-x3 you could write it as log(x)+(-x3) then as -x3 + log(x).

Just as -11+5-3+5=-4 would be the same as 5-11-3+5=-4 or -11-3+5+5=-4

Does my reasoning seem correct?

Thanks

Last edited:

Yes that is correct. I believe that falls under the commutative property which essentially states

x + y = y + x

And this would also go for multiplication, but not division correct?

Correct.

Example using decimal notation:

2*4 = 8 and 4*2 = 8

8 = 8 TRUE

2/4 = .5 and 4/2 = 2

.5 = 2 FALSE

And here's a tip, never be afraid to go back to the most basic of examples to solidify your thoughts if you start question them. Forget the log(x) and y^3 stuff and just use a scratch piece of paper and walk through simple things like 1+2 = 2+1 to convince yourself that the order of addition does not matter.

arildno
Homework Helper
Gold Member
Dearly Missed
Hi, ThomasMagnus!
As the others have said, you are correct.
The two operations multiplication and addition are COMMUTATIVE, i.e, you can change the order in which they appear.
Division and subtraction are NOT commutative, we can call them ANTI-commutative if you like.

But, as you yourself noted, can't we in 5-4 rewrite this as 5+(-4)=(-4)+5?

Yes, we can, by using negative numbers in addition, we can think of the operation of subtraction as "redundant", i.e, the info is contained in the use of adding with negative numbers instead.
That makes for easier calculations, because you then can go about commuting as much as you want!
In 5-(-4), for example, we just write 5-(-4)=5+(-(-4))=(-(-4))+5 and so on.

Does something similar exist with division relative to multiplication?

Yes, because division by a non-zero number "a" can always be thought of as multiplication with the reciprocal of "a", i.e, 1/a.

Thus, 2/4=2*(1/4)=(1/4)*2.

----------------
By thinking in terms of "negative numbers" and "reciprocals", you really have only two basic operations to worry about, addition and multiplication, rather than four operations.

(And, if you think of multiplication as repeated addition, there's only one fundamental operation to worry about..)

HallsofIvy
Homework Helper
And this would also go for multiplication, but not division correct?
Yes, and note that it is largely because (well, perhaps even more that addition and multiplication are "associative" while subtraction and division are not) that we do not consider subtraction and division as separate "operations" but just the inverses of additon and multiplication. That is, that "a subtract b" is just "a plus the additive inverse of b" and "a divided by b" is "a multiplied by the multiplicative inverse of b".

arildno
Homework Helper
Gold Member
Dearly Missed
When we think of ONE operation to be performed, commutativity is the only property that comes into the picture.
However, when we have two or more operations to be performed, we must also take into account what we call the associativity of the operations, that is, what relevance it has which operation we perform first.

We have, for example, for numbers "a", "b" and "c" that:
(a+b)+c=a+(b+c), that is, it doesn't matter WHICH addition we perform first. Addition is associative.

But, is:
(a-b)-c=a-(b-c)??

You easily see that subtraction is NOT associative at all;

We have that (a-b)-c=a-(b+c), whereas a-(b-c)=(a-b)+c

Thank you for the info! So the next time I see something in an answer key as something along the lines of x-b+c and I have -b+c+x I can assume they are the exact same, correct? Also, does this go for all terms, even something such as ln|x-1|-ln|x|+6=-ln|x|+ln|x-1|+6 ?

Thanks!

arildno
Homework Helper
Gold Member
Dearly Missed
"Also, does this go for all terms, even something such as ln|x-1|-ln|x|+6=-ln|x|+ln|x-1|+6"

That's right!

1 person


# Is there any other procedure to find the square root?

If no calculator is allowed, and we want to find the square root of a square number if it is large and analyzing to prime factors is hard, how can one proceed? For example, what to do if the number is a square of a large prime number like 5329?

What are methods to perform this and what are pedagogical reasons to prefer one over the other?

• I agree with @BenjaminDickman. This question is more for MSE. I wonder if it could be rewritten to explore any didactical issues or motivations. – Pablo B. Nov 14 '14 at 21:32
• well friends it is just by luck that I wrote the number to be 5329 .. the concept remains the same .. how to find the root of large numers .. I really voted for matin for the link he supplies. thank you all – Abdallah Abusharekh Nov 14 '14 at 21:37
• Related: hsm.stackexchange.com/q/56/72 – Joel Reyes Noche Nov 14 '14 at 23:39
• Following the (justified) remarks by @PabloB. and Benjamin Dickman I made explicit the educational aspect in the question, which is already present in some of the answers. – quid Nov 15 '14 at 13:26
• There're many methods on wikipedia page. – Ruslan Nov 15 '14 at 20:59

You can use (basically) Newton's method.

Take $x_0>0$, and define $$x_{k+1} = \frac{1}{2} (x_k + \frac{n}{x_k}).$$ The seqeunce converges to $\sqrt{n}$.

And if one starts with $x_0= n$ one has, as soon as $|x_{k+1} - x_k|< 1$, that $\lfloor x_{k+1} \rfloor = \lfloor\sqrt{n} \rfloor$.

But the above is not very feasible for computing by hand, and there is better variant, if you just want to do this for perfect squares or test if something is a perfect square, or more generally compute $\lfloor\sqrt{n} \rfloor$. (It seems this is the case for you.)

You can do $$x_{k+1} = \left \lfloor \frac{1}{2} (x_k + \lfloor \frac{n}{x_k} \rfloor) \right \rfloor$$ only doing arithemtic with integers (including euclidean division). This will converge to $\lfloor\sqrt{n} \rfloor$ in a finite number of iterations.

See Integer Square Root on Wikipedia for further references.

I think this could be an interesting method to teach, as one can provide a good geometric motivation for it.

There is an algorithm to calculate square roots with paper and pencil (like the long division algorithm). See How to calculate a square root without a calculator.

• I learned this in grade school. :-) – Joseph O'Rourke Nov 15 '14 at 21:13
• @JosephO'Rourke, I learned this in primary school! – Martín-Blas Pérez Pinilla Nov 19 '14 at 10:08

A fancy way, for those who know a little calculus, is to linearize $f(x)=\sqrt{x}$ at some point near the number you want to square root. This can only be done when you can think of a square rootable number that isn't too far away, so it's not going to work if you're trying to square root a super huge number, but if you can think of one, it's very doable by hand, and very quick. It also has the added benefit of giving you a rational approximation, if that's something you want.

For example, to compute $\sqrt{2}$, we first have to come up with some other number that is reasonably close to $2$ which we do know how to square root. The first thing that comes to mind is $9/4$ (though there are many other choices that are even more accurate, e.g. such as $49/25$). We linearize $\sqrt{x}$ at $9/4$: $$\left.\frac{d}{dx}\sqrt{x}\right|_{x=9/4}=\left.\frac{1}{2\sqrt{x}}\right|_{x=9/4}=\frac{1}{2\sqrt{9/4}}=\frac{1}{3}$$ $$\mathcal{L}_{9/4}(x)=f^\prime\left(\frac{1}{3}\right)\left(x-\frac{9}{4}\right)+f\left(\frac{9}{4}\right)=\frac{1}{3}\left(x-\frac{9}{4}\right)+\frac{3}{2}$$ Now, we plug $2$ in there. $$\mathcal{L}_{9/4}(2)=\frac{1}{3}\left(2-\frac{9}{4}\right)+\frac{3}{2}=\frac{17}{12}$$ From here, if you want decimals, you can simply use long division. Numerically, $17/12$ comes out to be $1.41667$, while the actual value of $\sqrt{2}$ is $1.41421\ldots$. That's pretty close, and likely close enough to do the job for many on the fly calculations.

• An easy nearby perfect square is always obtainable as the next-lowest or next-highest power of 10 (whichever has an even number of zeros). If you know your powers of two, you can do better using the next-lowest or next-highest power of two. – R.. GitHub STOP HELPING ICE Nov 15 '14 at 17:07

Use log tables and the identity $x^\alpha = e^{\alpha \log x}$.

From an educational point of view, that gives evidence of the usefulness of logarithms (you can calculate any power of $x$ using just a log table and multiplication) and teaches about transforming between problems. It also allows all roots to be calculated by the same method.

An intuitive approach to find the square root of A is to draw a square with the number (A) in the middle as the area, and the sides labeled x and y. We know that x times y equal A, and x is the square root of A when x = y. Begin with a rough estimate of x and calculate y as A/x. Now replace x with the average of the original x and y, and repeat.

For example, let's find the square root of 200. As a rough guess, let's begin with x = 15. Solve for y = 200/15 = 13.333. The new value for x, call it x1 = (15 + 13.333)/2 = 14.167. Now the new value y1 = 200/14.167 = 14.117. The square root of 200 is between 14.167 and 14.117. The average is 14.142. If we use x2 = 14.142, then y2 = 200/14.142 = 14.142, verifying that we have the square root of 200 with five significant digits.

This approach has the advantage of showing what a square root is visually, which can give a problem more meaning. The process makes intuitive sense, and it does not require mathematics beyond division.

Here is the method I used to solve the original poster's problem in about three seconds:

Square root (5329):

Steps 1a-d estimate the answer, to one significant figure, with the correct order of magnitude:

1b) Find the order of magnitude of the answer. Make a copy of the argument (5329). Shift the decimal of the copy of the argument by two places at a time, to get a number between 1 and 100. Shift the decimal of the estimated answer by one place at a time, in the opposite direction. For example, 53.29 and 10.

1c) Assume that the student knows the squares of the integers between 0 and 10 by heart. What is the closest such square? For example, 49.

1d) Multiply the estimated answer by the square root of the closest square. For example, square root (49) = 7, so the new estimated answer is 70.

Step 2 checks the estimate:

2) Square the current estimated answer. For example, 70 * 70 = 4900.

Steps 3a-d refine the estimate using uses (a+b)^2 = a^2 + 2*a*b + b^2. This is a special case of Newton's method:

3a) Subtract the value found in step 2 from the original argument, to yield a remainder. For example, 5329 - 4900 = 429. Keep track of the sign.

3b) Make a copy of the estimated answer. Multiply the copy by 2, to yield a double estimate. For example, 70 * 2 = 140.

3c) Divide the remainder by the double estimate, to yield an adjustment. Round off as convenient. Keep track of the sign. For example, 429 / 140 ~ 3.

3d) Add the adjustment to the estimate (not the double estimate). We kept track of the sign, so that we could correctly choose whether to add or subtract. For example, 70 + 3 = 73. For subsequent calculations, this value replaces estimate.

Repeat steps 2 - 3 until the answer is close enough. For example, 4900 + 420 + 3*3 = 5329, so the square root of 5329 is 73.

• I can do it in my head.

• It only requires keeping track of a few numbers.

• It quickly produces an estimated answer.

• It is a special case of Newton's method.

• Each time through the loop, the student can round off the adjustment to a convenient decimal or fraction.

• Every iteration, the student checks their work.

Three worked examples:

       Argu-   Estimated   Found                Double     Adjust-
Step   ment      Answer    So Far  Remainder    Estimate    ment     Notes
1a    5329        1
1b               10                                                 53.29
1c                                                                  7*7=49
1d               70
2     5329       70       4900
3a    5329       70       4900       429
3b    5329       70       4900       429        140
3c    5329       70       4900       429        140          3
2     5329       73       5329                                 73*73=4900+420+9
Done!

Step   ment      Answer    So Far  Remainder    Estimate    ment     Notes
1a     739        1
1b               10                                                  7.39
1c                                                                  3*3= 9
1d               30
2      739       30        900
3      739       30        900       -161        60        -3
2-3    739       27        729         10        54         0.2
2-3    739       27.2      739.84      -0.84     54.4      -0.015
2-3    739       27.185    739.024225  -0.024225 54.37     -0.0005
2-3    739       27.1845   738.99704025          54.369     0.00005
2      739       27.18455  738.9997587025
...Stop when satisfied...

Step   ment      Answer    So Far  Remainder    Estimate    ment     Notes
1a    4285        1
1b               10                                                 42.85
1c                                                                  6*6=36
1d               60
2-3   4285       60       3600       685       120         5
2-3   4285       65       4225        60       130         0.4
2-3   4285       65.4     4277.16      7.84    130.8       0.06
2-3   4285       65.46    4285.0116   -0.0116  130.92     -0.0001
2-3   4285       65.4599  4284.99850801        130.9198    0.00001
2     4285       65.45991 4284.9998171081
...Stop when satisfied...


# trace

### More from my site

• Does the Trace Commute with Matrix Multiplication? Is $\tr (A B) = \tr (A) \tr (B)$? Let $A$ and $B$ be $n \times n$ matrices. Is it always true that $\tr (A B) = \tr (A) \tr (B)$? If it is true, prove it. If not, give a counterexample.   Solution. There are many counterexamples. For one, take $A = \begin{bmatrix} 1 & 0 \\ 0 & 0 […] • Express the Eigenvalues of a 2 by 2 Matrix in Terms of the Trace and Determinant Let A=\begin{bmatrix} a & b\\ c& d \end{bmatrix} be an 2\times 2 matrix. Express the eigenvalues of A in terms of the trace and the determinant of A. Solution. Recall the definitions of the trace and determinant of A: \[\tr(A)=a+d \text{ and } […] • Is the Trace of the Transposed Matrix the Same as the Trace of the Matrix? Let A be an n \times n matrix. Is it true that \tr ( A^\trans ) = \tr(A)? If it is true, prove it. If not, give a counterexample. Solution. The answer is true. Recall that the transpose of a matrix is the sum of its diagonal entries. Also, note that the […] • If Two Matrices are Similar, then their Determinants are the Same Prove that if A and B are similar matrices, then their determinants are the same. Proof. Suppose that A and B are similar. Then there exists a nonsingular matrix S such that \[S^{-1}AS=B$ by definition. Then we […]
• An Example of a Matrix that Cannot Be a Commutator Let $I$ be the $2\times 2$ identity matrix. Then prove that $-I$ cannot be a commutator $[A, B]:=ABA^{-1}B^{-1}$ for any $2\times 2$ matrices $A$ and $B$ with determinant $1$.   Proof. Assume that $[A, B]=-I$. Then $ABA^{-1}B^{-1}=-I$ implies $ABA^{-1}=-B. […] • If 2 by 2 Matrices Satisfy A=AB-BA, then A^2 is Zero Matrix Let A, B be complex 2\times 2 matrices satisfying the relation \[A=AB-BA.$ Prove that $A^2=O$, where $O$ is the $2\times 2$ zero matrix.   Hint. Find the trace of $A$. Use the Cayley-Hamilton theorem Proof. We first calculate the […]
• Matrix $XY-YX$ Never Be the Identity Matrix Let $I$ be the $n\times n$ identity matrix, where $n$ is a positive integer. Prove that there are no $n\times n$ matrices $X$ and $Y$ such that $XY-YX=I.$   Hint. Suppose that such matrices exist and consider the trace of the matrix $XY-YX$. Recall that the trace of […]
• Matrices Satisfying $HF-FH=-2F$ Let $F$ and $H$ be an $n\times n$ matrices satisfying the relation $HF-FH=-2F.$ (a) Find the trace of the matrix $F$. (b) Let $\lambda$ be an eigenvalue of $H$ and let $\mathbf{v}$ be an eigenvector corresponding to $\lambda$. Show that there exists an positive integer $N$ […]


# How to solve an ODE of this form $\dot{P}(t)=A^TP(t)+P(t)A$?

Background

If $$\dot{x}(t)=A \,x(t)$$, then we know the solution is $$x(t)=e^{At}x(0)$$.

Question

Now let $$\dot{P}(t)=A^TP(t)+P(t)A$$, what is $$P(t)$$?

Attempt

If we take $$P(t)$$ as common factor (I'm not sure I'm doing this correctly though) ,then we have: $$\dot{P}(t)=A^TP(t)+P(t)A=(A^T+A)P(t)$$ and using the same rationale in the background section, we have $$P(t)=e^{(A^T+A) t}P(0)=e^{A^T t}P(0)e^{At}$$ Is this a correct solution?

Note

I know the answer is $$P(t)=e^{A^T t}P(0)e^{At}$$ but I'm not sure how to find it.

• Counter question: what is A? – Yuriy S Oct 16 '18 at 16:28
• @YuriyS A is a matrix. – Lod Oct 16 '18 at 16:29
• Dimensions are very likely mismatched in the expression $\dot{p}(t)=A^Tp(t)+p(t)A$. – Ennar Oct 16 '18 at 16:30
• What is $p A$ then? – Yuriy S Oct 16 '18 at 16:30
• @Ennar I fixed the question. – Lod Oct 16 '18 at 16:36

Consider the differential equation $$\dot{P}(t)=A^TP(t)+P(t)A$$

We can rewrite it as: $$\dot{P}(\tau)-A^TP(\tau)-P(\tau)A=0$$

Multiply the last differential equation by $$e^{-A^T\tau}$$ from the left and by $$e^{-A\tau}$$ from the right then

$$$$e^{-A^T\tau}\dot{P}(\tau)e^{-A\tau}-e^{-A^T\tau}A^TP(\tau)e^{-A\tau}-e^{-A^T\tau}P(\tau)Ae^{-A\tau}=0 \quad (1)$$$$ We can easily see that equation $$(1)$$ is generated by the derivative of three multiplied functions: $$$$\frac{d}{d\tau}\bigg(e^{-A^T\tau}{P}(\tau)e^{-A\tau}\bigg)=e^{-A^T\tau}\dot{P}(\tau)e^{-A\tau}-A^Te^{-A^T\tau}P(\tau)e^{-A\tau}-e^{-A^T\tau}P(\tau)Ae^{-A\tau}=0$$$$

So we come up with:

$$0=\frac{d}{d\tau}\bigg(e^{-A^T\tau}{P}(\tau)e^{-A\tau}\bigg)$$

Take the integral of both sides

$$$$0=\int_0^t\frac{d}{d\tau}\bigg(e^{-A^T\tau}{P}(\tau)e^{-A\tau}\bigg)d\tau=\bigg(e^{-A^T\tau}{P}(\tau)e^{-A\tau}\bigg)\bigg]_0^t=e^{-A^Tt}{P} \tau)e^{-At}-e^{0}{P}(0)e^{0}$$$$ \ $$$$0=e^{-A^Tt}{P}(t)e^{-At}-P(0)$$$$

Multiply left and right sides by $$e^{A^Tt}$$ and $$e^{At}$$ respectively, we get:

$$$$P(t)=e^{A^Tt}{P}(0)e^{At}$$$$

Note: I used the fact that $$e^{-A^T\tau}$$ and $$A^T$$ commute, i.e. $$A^Te^{-A^T\tau}=e^{-A^T\tau}A^T$$

For small time increment you get approximately $$P(t+dt)=P(t)+(A^TP(t)+P(t)A)dt+O(dt^2)=(I+A^T\,dt)P(t)(I+A\,dt)+O(dt^2)$$ which means that from time step to time step you get an accumulation of these factors on both sides, $$P(N\,dt)=(I+A^T\,dt)^NP(t)(I+A\,dt)^N+O(Ndt^2)$$ Now if $$N\,dt=\Delta t$$ we get, using $$(I+B/N)^N=\exp(B)+O(B^2/N)$$ $$P(t+Δt)=e^{A^T\,Δt}P(t)e^{A\,Δt}+O(Δt\,dt)$$ so that for $$dt\to 0$$ one gets exactly the claimed solution form.

By vectorizing $$P$$ and using the Kronecker product, similar to a method which can be used to solve Sylvester equations, then the differential equation can also be written as

$$\frac{d}{dt}\,\text{vec}\,P(t) = \underbrace{\left(I \otimes A^\top + A^\top\otimes I\right)}_{M}\,\text{vec}\,P(t), \tag{1}$$

which has the solution

$$\text{vec}\,P(t) = e^{M\,t}\,\text{vec}\,P(0). \tag{2}$$

By using the mixed-product property of the Kronecker product it can be shown that $$I \otimes A^\top$$ commutes with $$A^\top \otimes I$$. This commuting property allows you to write the matrix exponential as

$$e^{M\,t} = e^{(I\,\otimes\,A^\top)\,t}\,e^{(A^\top\,\otimes\,I)\,t}. \tag{3}$$

By using the definition of a matrix exponential and again the mixed-product property of the Kronecker product then is can also be shown that

$$e^{X\,\otimes\,I} = e^{X} \otimes I, \quad e^{I\,\otimes\,X} = I \otimes e^{X},$$

thus

$$e^{M\,t} = \left(I \otimes e^{A^\top t}\right) \left(e^{A^\top t} \otimes I\right). \tag{4}$$

Substituting $$(4)$$ into $$(2)$$ gives

\begin{align} \text{vec}\,P(t) &= \left(I \otimes e^{A^\top t}\right) \left(e^{A^\top t} \otimes I\right) \text{vec}\,P(0) \\ &= \left(I \otimes e^{A^\top t}\right) \text{vec}\left(P(0)\,e^{A\,t}\right) \\ &= \text{vec}\left(e^{A^\top t}\,P(0)\,e^{A\,t}\right) \end{align}

thus

$$P(t) = e^{A^\top t}\,P(0)\,e^{A\,t}.$$


# Series convergence

1. Jun 10, 2009

### utopiaNow

1. The problem statement, all variables and given/known data
Use partial fractions to show
$$\displaystyle\sum_{n=1}^\infty \frac{1}{n(n+1)(n+2)} = \frac{1}{4}$$

3. The attempt at a solution
I did the partial fraction decomposition to get: $$\displaystyle\sum_{n=1}^\infty \frac{1}{2n} - \frac{1}{n + 1} + \frac{1}{2n + 4}$$

I'm not sure how to proceed from here, in my textbook the example shows how terms in the partials sums overlap and cancel out if you start looking at the terms in the partial fraction decomposition, however I can't see that happening with this particular series.

Any suggestions would be appreciated. Thanks in advance.

2. Jun 10, 2009

### rock.freak667

Write out a few term, n=1,2,3,4,5....N-3,N-2,N-1,N

then check as N->inf.

3. Jun 10, 2009

### utopiaNow

Hi,

I tried doing that originally, but I don't see any patterns that I can exploit when I write the terms of the partial decomposition for n = 1, 2, 3,..., N-2, N-1, N as you stated.

Do you have any further suggestions?

4. Jun 10, 2009

### Dick

Write the terms for successive values of n each on a row 1/(2n+4) -1/(n+1) 1/(2n)
1/6 -1/2 1/2
1/8 -1/3 1/4
1/10 -1/4 1/6
1/12 -1/5 1/8
1/14 -1/6 1/10

Oblique hint: diagonal.

5. Jun 10, 2009

### utopiaNow

Interesting, so everything seems to be canceling out if you keep going long enough diagonally, except the 1/4 in the second row. However is there any way to formalize this? Or is simply noticing this pattern enough for a formal proof?

6. Jun 10, 2009

### Dick

Depends on how formal you want to be. Writing a table like that and scratching out the cancellations is good for me. If you want to do it formally write out the first term from the n case, the second term from the n+1 case and the third term from the n+2 case and show they cancel algebraically. What is important is to realize just because there isn't an obvious cancellation doesn't mean there isn't one.

7. Jun 10, 2009

### utopiaNow

Thank you for the help!

8. Jun 10, 2009

### txy

why not take out 1/2 from the partial fraction decomposition so that it's more obvious?

$$\sum^{+\infty}_{n=1}(\frac{1}{2n}-\frac{1}{n+1}+\frac{1}{2n+4})$$
$$= \frac{1}{2}\sum^{+\infty}_{n=1}(\frac{1}{n}-\frac{2}{n+1}+\frac{1}{n+2})$$
$$= \frac{1}{2}\sum^{+\infty}_{n=1}(\frac{1}{n}-\frac{1}{n+1}+\frac{1}{n+2}-\frac{1}{n+1})$$
$$= \frac{1}{2}\sum^{+\infty}_{n=1}(\frac{1}{n}-\frac{1}{n+1}) + \frac{1}{2}\sum^{+\infty}_{n=1}(\frac{1}{n+2}-\frac{1}{n+1})$$

9. Jun 10, 2009

### Dick

That's a nice way to handle it. There's more than one way to skin a cat.


# Solutions of $x^2-6x-13 \equiv 0 \pmod{127}$

I started learning number theory, specifically polynomial congruences, and need help with the following exercise. Here it is:

Does the congruence $x^2-6x-13 \equiv 0 \pmod{127}$ has solutions?

I tried to follow the method for solving general quadratic congruence but I didn't get really far. Here's what I've done so far:

Since $(4, 127) = 1$, we may complete the square by multiplying by $4$ without having to change the modulus in order to get the following equivalent congruence

$$(2x-6)^2 \equiv 36 - 4(-13) \pmod{127} \iff (2x-6)^2 \equiv 88 \pmod{127}.$$

If I'm heading in the right direction then I don't know how to continue from here. I suspect there is another method for solving this problem since I didn't make use of the fact that $127$ is prime. Also, the problem doesn't require to actually find the solutions but only determine if there are solutions. Possibly we can avoid computations and make use of some theorem/lemma to find if the congruence has solutions or not.

• The quadratic formula, $x = \frac{6\pm\sqrt{(-6)^2 - 4\cdot 1\cdot (-13)}}{2\cdot 1}$ still works, since $127$ is an odd prime. Note, however, that square root and dividing by $2$ has a different meaning from what it does for real numbers (or, it has the same meaning, but potentially a very different result). – Arthur Sep 19 '17 at 11:16

. To find solutions of $$x^2 - 6x - 13 \equiv 0 \mod 127$$, we must write $$x^2-6x - 13$$ as a square of a linear term, plus a constant. It's seen easily that $$x^2 - 6x - 13 = (x-3)^2 - 22$$. Hence, the congruence is equivalent to $$(x-3)^2 \equiv 22 \mod 127$$.

Now, we must check if $$22$$ is a quadratic residue mod $$127$$. For this, we can use the Legendre symbol, whose notation I will keep the same as the binomial, so do not get confused. $$\binom{22}{127} = \color{green}{\binom{11}{127}}\color{red}{\binom{2}{127}} = \color{green}{-\binom{127}{11}} \times \color{red}1$$ where the terms with same color on the LHS and RHS are equal. The green equality comes by quadratic reciprocity and the second comes by the fact that $$\binom{2}{p}$$ is well known by the remainders which $$p$$ leaves when divided by $$8$$.

Now, we can do: $$-\binom{127}{11} = -\binom{6}{11} = -\color{green}{\binom{2}{11}}\color{red}{ \binom{3}{11}} = -\color{green}{(-1)}\color{red}{(1)} = 1$$

Again, the colored terms on the LHS and RHS are equal because the quantities $$\binom 2p$$ and $$\binom 3p$$ are well known.

Since we have obtained that the Legendre symbol is $$1$$, this implies the existence of a solution, and therefore two.

The question, though, is how to compute them. I do not know of any method other than brute force, unfortunately. However, our reward for writing $$(x-3)^2 \equiv 22 \mod 127$$ is that we basically only need to look for squares of the form $$127k + 22$$ to find a solution, rather than having to substitute values of $$x$$ into the expression $$x^2-6x-13$$ each time.

A brute force : the series $$127k + 22$$ goes like : $$22,149,276,403,530,657,\color{blue}{784},...$$

lo and behold, $$784 = 28^2$$, hence this gives $$x = 31$$. Now, note that the congruence actually has two solutions, one given by $$127 - 28 = 99$$. You can check that $$9801 = 99^2 = 22 + 127 \times 77$$.

Hence, we get two solutions of $$x$$, namely $$x= 31,102$$.

• I can't thank you enough for this answer! I understood everything and it made me see the link that I was missing between quadratic polynomial/residues and Legendre symbol. – user347616 Sep 19 '17 at 12:07
• But of course, you are welcome! I should mention, +1 for your question. – астон вілла олоф мэллбэрг Sep 19 '17 at 12:08
• Since $127$ is one less than a multiple of $4$, you can get the square roots by "root-power conversion". Fermat's Little Theorem gives $22^{126}\equiv 1$, and with $22$ being a quadratic residue then $22^{63}\equiv 1$. So $22^{64}\equiv 22$ assuring that $22^{32}\equiv 99$ will be one square root. Try it! – Oscar Lanzi Sep 19 '17 at 12:26
• That is a much,much better method than the one I have suggested. I thank you for this. – астон вілла олоф мэллбэрг Sep 19 '17 at 12:29

Using the Berlekamp Algorithm for factoring a polynomial over $\mathbb{F}_{127}$ we immediately obtain that $$x^2-6x-13=(x+25)(x+96).$$ So we have two solutions.

I am a congruence beginner like you.

I did in this way

completed the square $(x-3)^2-9\equiv 13 \mod 127$

$(x-3)^2\equiv 22 \mod 127$

Now call $r$ is the number such that $r^2\equiv 22\mod 127$?

Like a "modular" square root

I found here a way to find the roots

As $127\equiv 3 \mod 4$ then we have $r= \pm 22^{\frac{128}{4}} \mod 127$

$22^{32} =2^{32}\cdot 11^{32}$

$2^7\equiv 1 \mod 127\to 2^{28}\equiv 1 \mod 127\to \color{red}{2^{32}\equiv 2^4\mod 127}$

$11^{32}=121^{16}$ as $121\equiv 6 \mod 127$ we have $121^{16}\equiv 6^{16} \mod 127$ and then $6^{16}\equiv 2^{16}\cdot 3^{16} \mod 127$

$2^k \mod 127$ for $k=0,1,2\ldots$ is cyclical and is $1,2,4,8,16,32,64$ then repeats (because $127=2^7-1$) therefore $2^{16}\equiv 4 \mod 127$

$3^{16}\equiv 81^4 \mod 127\to 3^{16}\equiv 71 \mod 127$

Finally $6^{16}\equiv 4\cdot 71 \mod 127\to 6^{16}\equiv 30 \mod 127$ and $\color{red}{11^{32}\equiv 6^{16}\equiv 30 \mod 127}$

Collecting the parts in red colour we get $22^{32}\equiv 2^4\cdot 30 \mod 127$ that is $22^{32}\equiv 99\mod 127$ and $-22^{32} \equiv 28 \mod 127$

Concluding the two solutions are $x-3\equiv 99 \mod 127\to x\equiv 102 \mod 127$ and $x-3\equiv 28 \mod 127 \to x\equiv 31 \mod 127$

Edit

My solution is all but elegant. Anyway is a solution provided by a beginner like you and I hope it is understandable

• It took me a little time to go through your solution but I made it. Thank you for the effort, it is always enlightening to see different solutions to the same problem. (+1) – user347616 Sep 19 '17 at 14:59
• To compute $22^{32} \bmod127$ just square five successive times. – Oscar Lanzi Sep 19 '17 at 22:33
• @OscarLanzi Why $22^{32}\equiv 22^5 \mod 127$? – Raffaele Sep 20 '17 at 13:11
• I did not say that. Square five successive times means $22^{2^5}$. – Oscar Lanzi Sep 20 '17 at 13:42

I think you can try $$x=31.$$ It is valid.

Finally we have $$x^2-6x-13\equiv(x-31)(x-102) \pmod{127}.$$

This equation has roots modulo $127$ if and only if the reduced discriminant $\Delta'=9+13$ is a square modulo $127$. We'll use the laws of quadratic reciprocity.

$$\biggl(\frac{22}{127}\biggr)=\biggl(\frac{2}{127}\biggr)\biggl(\frac{11}{127}\biggr)=\biggl(\frac{11}{127}\biggr)\quad\text{since }127\equiv -1\mod8\quad (2^{\mathit{nd}}\textit{supplementary law}).$$ Now we have \begin{align}\biggl(\frac{11}{127}\biggr)&=\biggl(\frac{127}{11}\biggr)\bigl(-1\bigr)^{\tfrac{10\cdot126}4}=-\biggl(\frac{6}{11}\biggr)=-\biggl(\frac{2}{11}\biggr)\biggl(\frac{3}{11}\biggr)\\[1ex] &=+\biggl(\frac{3}{11}\biggr)=\biggl(\frac{11}{3}\biggr)\bigl(-1\bigr)^{\tfrac{2\cdot10}4}=-\biggl(\frac{2}{3}\biggr)=+1. \end{align} Thus the equation has roots.


# Relations between p norms

The $$p$$-norm on $$\mathbb R^n$$ is given by $$\|x\|_{p}=\big(\sum_{k=1}^n |x_{k}|^p\big)^{1/p}$$. For $$0 < p < q$$ it can be shown that $$\|x\|_p\geq\|x\|_q$$ (1, 2). It appears that in $$\mathbb{R}^n$$ a number of opposite inequalities can also be obtained. In fact, since all norms in a finite-dimensional vector space are equivalent, this must be the case. So far, I only found the following: $$\|x\|_{1} \leq\sqrt n\,\|x\|_{2}$$(3), $$\|x\|_{2} \leq \sqrt n\,\|x\|_\infty$$ (4). Geometrically, it is easy to see that opposite inequalities must hold in $$\mathbb R^n$$. For instance, for $$n=2$$ and $$n=3$$ one can see that for $$0 < p < q$$, the spheres with radius $$\sqrt n$$ with $$\|\cdot\|_p$$ inscribe spheres with radius $$1$$ with $$\|\cdot\|_q$$.

It is not hard to prove the inequality (4). According to Wikipedia, inequality (3) follows directly from Cauchy-Schwarz, but I don't see how. For $$n=2$$ it is easily proven (see below), but not for $$n>2$$. So my questions are:

1. How can relation (3) be proven for arbitrary $$n\,$$?
2. Can this be generalized into something of the form $$\|x\|_{p} \leq C \|x\|_{q}$$ for arbitrary $$0?
3. Do any of the relations also hold for infinite-dimensional spaces, i.e. in $$l^p$$ spaces?

Notes:

$$\|x\|_{1}^{2} = |x_{1}|^2 + |x_{2}|^2 + 2|x_{1}||x_{2}| \leq |x_{1}|^2 + |x_{2}|^2 + \big(|x_{1}|^2 + |x_{2}|^2\big) = 2|x_{1}|^2 + 2|x_{2}|^2$$, hence $$=2\|x\|_{2}^{2}$$
$$\|x\|_{1} \leq \sqrt 2 \|x\|_{2}$$. This works because $$|x_{1}|^2 + |x_{2}|^2 \geq 2|x_{1}\|x_{2}|$$, but only because $$(|x_{1}| - |x_{2}|)^2 \geq 0$$, while for more than two terms $$\big(|x_{1}| \pm |x_{2}| \pm \dotsb \pm |x_{n}|\big)^2 \geq 0$$ gives an inequality that never gives the right signs for the cross terms.

• Your first link (1) has exactly the equation you seek. Actually a version of Norberts excellent answer, generalized to measure spaces. – Thomas Ahle Mar 31 '16 at 20:57
• Probably a dead thread, but norms in finite dimensional spaces are equivalent, so one can always find c ad C such that $c\|x\|_p\leq \|x\|_q\leq C\|x\|_p$. – BigM Dec 1 '19 at 20:23

1. Using Cauchy–Schwarz inequality we get for all $x\in\mathbb{R}^n$ $$\Vert x\Vert_1= \sum\limits_{i=1}^n|x_i|= \sum\limits_{i=1}^n|x_i|\cdot 1\leq \left(\sum\limits_{i=1}^n|x_i|^2\right)^{1/2}\left(\sum\limits_{i=1}^n 1^2\right)^{1/2}= \sqrt{n}\Vert x\Vert_2$$
2. Such a bound does exist. Recall Hölder's inequality $$\sum\limits_{i=1}^n |a_i||b_i|\leq \left(\sum\limits_{i=1}^n|a_i|^r\right)^{\frac{1}{r}}\left(\sum\limits_{i=1}^n|b_i|^{\frac{r}{r-1}}\right)^{1-\frac{1}{r}}$$ Apply it to the case $|a_i|=|x_i|^p$, $|b_i|=1$ and $r=q/p>1$ $$\sum\limits_{i=1}^n |x_i|^p= \sum\limits_{i=1}^n |x_i|^p\cdot 1\leq \left(\sum\limits_{i=1}^n (|x_i|^p)^{\frac{q}{p}}\right)^{\frac{p}{q}} \left(\sum\limits_{i=1}^n 1^{\frac{q}{q-p}}\right)^{1-\frac{p}{q}}= \left(\sum\limits_{i=1}^n |x_i|^q\right)^{\frac{p}{q}} n^{1-\frac{p}{q}}$$ Then $$\Vert x\Vert_p= \left(\sum\limits_{i=1}^n |x_i|^p\right)^{1/p}\leq \left(\left(\sum\limits_{i=1}^n |x_i|^q\right)^{\frac{p}{q}} n^{1-\frac{p}{q}}\right)^{1/p}= \left(\sum\limits_{i=1}^n |x_i|^q\right)^{\frac{1}{q}} n^{\frac{1}{p}-\frac{1}{q}}=\\= n^{1/p-1/q}\Vert x\Vert_q$$ In fact $C=n^{1/p-1/q}$ is the best possible constant.
• @Arun, because for $x=(1,1,1,\ldots,1)$ this bound is attained – Norbert Jun 10 '15 at 14:27
• @Norbert: I'm trying to derive a similar bound for the case $p>q$. Any ideas about how to proceed ? – pikachuchameleon Jun 22 '15 at 12:19
• @AshokVardhan what does "similar" mean? Do you want to prove something like $\Vert x\Vert_p \leq C\Vert x\Vert_q$ for $p>q$ ? – Norbert Jun 23 '15 at 14:24


Question

# A point moves such that the sum of the square of its distance from the sides of a sqaure of side unity is equal to $$9$$. The locus of the point is a circle such that

A
Center of the circle coincides with that of square
B
Center of the circle is (12,12)
C
Radius of the circle is 2
D
All the above are true

Solution

## The correct option is D All the above are trueLet the sides of the square be $$y=0,y=1,x=0$$ and $$x=1.$$Let the moving point be $$(x,y).$$Then,$${ y }^{ 2 }+{ \left( y-1 \right) }^{ 2 }+{ x }^{ 2 }+{ \left( x-1 \right) }^{ 2 }=9$$ is the equation of the locus.$$\Rightarrow 2{ x }^{ 2 }+2{ y }^{ 2 }-2x-2y-7=0,$$ which represents a circle having centre $$\displaystyle \left( \frac { 1 }{ 2 } ,\frac { 1 }{ 2 } \right)$$ (which is also the centre of the square) and radius $$2.$$  Mathematics

Suggest Corrections

0

Similar questions
View More

People also searched for
View More


# Looking for a proof of an interesting identity

Working on a problem I have encountered an interesting identity:

$$\sum_{k=0}^\infty \left(\frac{x}{2}\right)^{n+2k}\binom{n+2k}{k} =\frac{1}{\sqrt{1-x^2}}\left(\frac{1-\sqrt{1-x^2}}{x}\right)^n,$$ where $n$ is a non-negative integer number and $x$ is a real number with absolute value less than 1 (probably a similar expression is valid for arbitrary complex numbers $|z|<1$).

Is there any simple proof of this identity?

• How/where did you meet this identity? Is the LHS just the Taylor series for the RHS? – Daniel Robert-Nicoud Dec 14 '17 at 23:38
• Anything to do with a random walk? Why did you call this interesting, btw? – Mathemagical Dec 14 '17 at 23:44
• Reminiscent of the explicit form for Chebyshev polynomials of the first kind, hence they idea of enforcing the substitution $x=\sin\theta$ and applying the residue theorem looks like a promising one ;) – Jack D'Aurizio Dec 14 '17 at 23:56
• Or you may prove that both sides are the terms of an Appell / Fibonacci sequence of polynomials. – Jack D'Aurizio Dec 14 '17 at 23:57
• @tired This is in regard to the hitting time of a random walk (more particularly, the probability generating function of the hitting time of the walk at the barrier x=1. Please see the equations 15,16, and 17 in the linked document. galton.uchicago.edu/~lalley/Courses/312/RW.pdf The details of the computation are not listed here, but they are shown in greater detail in Michael Steele's book, Stochastic Calculus and Financial applications (pages 8 and 9). – Mathemagical Dec 16 '17 at 15:25

Using

$$\binom{n}{k}=\frac{1}{2 \pi i}\oint_C\frac{(1+z)^{n}}{z^{k+1}}dz$$ we get (integration contour is the unit cicrle)

$$2\pi iS_n=\oint dz \sum_{k=0}^{\infty}\frac{(1+z)^{n+2k}x^{n+2k}}{z^{k+1}2^{n+2k}}=\oint dz \frac{(1+z)^n x^n}{z2^n}\sum_{k=0}^{\infty}\frac{(1+z)^{2k}x^{2k}}{2^{2k}z^k}=\\ 4\frac{x^n}{2^n}\oint dz \underbrace{\frac{(1+z)^n}{4z-(1+z)^2x^2}}_{f(z)}$$

for $|x|<1$ only we have just one pole of $f(z)$ inside the unit circle namely $z_0(x)=\frac2{x^2}-\frac{2\sqrt{1-x^2}}{x^2}-1$ , so

$$S_n=4\frac{x^n}{2^n}\text{res}(f(z),z=z_0(x))=4\frac{x^n}{2^n}\left[ \frac{1}{4 \sqrt{1-x^2}}\left(2\frac{1-\sqrt{1-x^2}}{ x^2}\right)^n\right]$$

or

$$S_n=\frac{1}{\sqrt{1-x^2}}\left(\frac{1-\sqrt{1-x^2}}{ x}\right)^n$$

• Thanks Jack :-) – tired Dec 15 '17 at 0:55
• @tired: Thank you very much for the nice proof. It contains however a misprint. $4$ shall be replaced with $4^{1/n}$ in the denominator of the residue value. But probably simpler and more correctly were to write it just as $$\text{res}(f(z),z=z_0)=\frac{1}{4\sqrt{1-x^2}} \left(2\frac{1-\sqrt{1-x^2}}{x^2}\right)^n.$$ – user Dec 15 '17 at 11:56
• @user355705 you are absolutly right – tired Dec 16 '17 at 15:07

Extracting coefficients on the RHS we get the integral (coefficient on $x^{n+2k}$)

$$\frac{1}{2\pi i} \int_{|z|=\epsilon} \frac{1}{z^{n+2k+1}} \frac{1}{\sqrt{1-z^2}} \left(\frac{1-\sqrt{1-z^2}}{z}\right)^n \; dz.$$

Now we put $(1-\sqrt{1-z^2})/z = w$ so that $z = 2w/(1+w^2).$ This has $w = \frac{1}{2} z + \cdots$ so the image in $w$ of the contour in $z$ can be deformed to a small circle enclosing the origin in the $w$-plane. (Moreover we see that the exponentiated term starts at $z^n$ which justifies the corresponding offset in the series.) We get $dz = 2/(1+w^2) - 4w^2/(1+w^2)^2 \; dw = 2(1-w^2)/(1+w^2)^2 \; dw.$ We also have $1-z^2 = 1 - 4w^2/(1+w^2)^2 = (1-w^2)^2/(1+w^2)^2.$ All of this yields

$$\frac{1}{2\pi i} \int_{|w|=\gamma} \frac{(1+w^2)^{n+2k+1}}{2^{n+2k+1} w^{n+2k+1}} \frac{1}{(1-w^2)/(1+w^2)} w^n \frac{2(1-w^2)}{(1+w^2)^2} \; dw \\ = \frac{1}{2^{n+2k}} \frac{1}{2\pi i} \int_{|w|=\gamma} \frac{(1+w^2)^{n+2k}}{w^{2k+1}} \; dw.$$

This evaluates by inspection to

$$\frac{1}{2^{n+2k}} [w^{2k}] (1+w^2)^{n+2k} = \frac{1}{2^{n+2k}} [w^{k}] (1+w)^{n+2k} \\ = \frac{1}{2^{n+2k}} {n+2k\choose k}$$

which is the claim.

I plan to insert this approach into the next (2019) version of my notes.
The even powers of $\arcsin(x)$ all have a nice Maclaurin series (see eqs (19),(20),(21),(22)), and this can be seen as a side effect of the Lagrange–Bürmann inversion theorem. I am going to implement the same trick here, by computing the derivatives at the origin of the RHS (the opposite way has already been investigated by tired).

$$[x^m]\left[\frac{1}{\sqrt{1-x^2}}\left(\frac{1-\sqrt{1-x^2}}{x}\right)^n\right]=\frac{1}{2\pi i}\oint\frac{(1-\sqrt{1-x^2})^n}{x^{n+m+1}\sqrt{1-x^2}}\,dx$$ where the integral is performed along a small circle enclosing the origin. What about enforcing the substitution $x=\sin z$? The sine function is holomorphic and injective in a neighbourhood of the origin, hence the RHS is simply converted into $$\frac{1}{2\pi i}\oint\frac{(1-\cos z)^n}{\left(\sin z\right)^{n+m+1}}\,dz =\frac{1}{2\pi i}\oint\frac{2^n \sin^{2n}\frac{z}{2}}{2^{n+m+1}\sin^{n+m+1}\frac{z}{2}\cos^{n+m+1}\frac{z}{2}}\,dz$$ or $$\frac{1}{2\pi i}\oint\frac{\tan^{n-m-1}z}{2^{m}\cos^{2m}z}\,dz=\frac{1}{2^{m+1}\pi i}\oint u^{n-m-1}(1+u^2)^{m-1}\,du$$ via $z\to 2z$ and $z\to\arctan u$. Now the RHS is trivially given by a binomial coefficient multiplied by $\frac{1}{2^m}$ (provided by $m\geq n$) and the claim is proved.


# fimplicit3

Plot 3-D implicit equation or function

## Syntax

fimplicit3(f)
fimplicit3(f,[min max])
fimplicit3(f,[xmin xmax ymin ymax zmin zmax])
fimplicit3(___,LineSpec)
fimplicit3(___,Name,Value)
fimplicit3(ax,___)
fi = fimplicit3(___)

## Description

example

fimplicit3(f) plots the 3-D implicit equation or function f(x,y,z) over the default interval [-5 5] for x, y, and z.

example

fimplicit3(f,[min max]) plots f(x,y,z) over the interval [min max] for x, y, and z.

example

fimplicit3(f,[xmin xmax ymin ymax zmin zmax]) plots f(x,y,z) over the interval [xmin xmax] for x, [ymin ymax] for y, and [zmin zmax] for z. The fimplicit3 function uses symvar to order the variables and assign intervals.

example

fimplicit3(___,LineSpec) uses LineSpec to set the line style, marker symbol, and face color.

example

fimplicit3(___,Name,Value) specifies line properties using one or more Name,Value pair arguments. Use this option with any of the input argument combinations in the previous syntaxes.
fimplicit3(ax,___) plots into the axes with the object ax instead of the current axes object gca.

example

fi = fimplicit3(___) returns an implicit function surface object. Use the object to query and modify properties of a specific surface. For details, see ImplicitFunctionSurface Properties.

## Examples

collapse all

Plot the hyperboloid ${x}^{2}+{y}^{2}-{z}^{2}=0$ by using fimplicit3. The fimplicit3 function plots over the default interval of $\left[-5,5\right]$ for $x$, $y$, and $z$.

syms x y z fimplicit3(x^2 + y^2 - z^2)

Plot the hyperboloid specified by the function $f\left(x,y,z\right)={x}^{2}+{y}^{2}-{z}^{2}$. The fimplicit3 function plots over the default interval of $\left[-5,5\right]$ for $x$, $y$, and $z$.

syms f(x,y,z) f(x,y,z) = x^2 + y^2 - z^2; fimplicit3(f)

Specify the plotting interval by specifying the second argument to fimplicit3. Plot the upper half of the hyperboloid ${x}^{2}+{y}^{2}-{z}^{2}=0$ by specifying the interval $0. For $x$ and $y$, use the default interval $\left[-5,5\right]$.

syms x y z f = x^2 + y^2 - z^2; interval = [-5 5 -5 5 0 5]; fimplicit3(f, interval)

Plot the implicit equation $x\mathrm{sin}\left(y\right)+z\mathrm{cos}\left(x\right)=0$ over the interval $\left(-2\pi ,2\pi \right)$ for all axes.

Create the x-axis ticks by spanning the x-axis limits at intervals of pi/2. Convert the axis limits to precise multiples of pi/2 by using round and get the symbolic tick values in S. Display these ticks by using the XTick property. Create x-axis labels by using arrayfun to apply texlabel to S. Display these labels by using the XTickLabel property. Repeat these steps for the y-axis.

To use LaTeX in plots, see latex.

syms x y z eqn = x*sin(y) + z*cos(x); fimplicit3(eqn,[-2*pi 2*pi]) title('xsin(y) + zcos(x) for -2\pi < x < 2\pi and -2\pi < y < 2\pi') xlabel('x') ylabel('y') ax = gca; S = sym(ax.XLim(1):pi/2:ax.XLim(2)); S = sym(round(vpa(S/pi*2))*pi/2); ax.XTick = double(S); ax.XTickLabel = arrayfun(@texlabel,S,'UniformOutput',false); S = sym(ax.YLim(1):pi/2:ax.YLim(2)); S = sym(round(vpa(S/pi*2))*pi/2); ax.YTick = double(S); ax.YTickLabel = arrayfun(@texlabel, S, 'UniformOutput', false);

Plot the implicit surface ${x}^{2}+{y}^{2}-{z}^{2}=0$ with different line styles for different values of $z$. For $-5, use a dashed line with green dot markers. For $-2, use a LineWidth of 1 and a green face color. For $2, turn off the lines by setting EdgeColor to none.

syms x y z f = x^2 + y^2 - z^2; fimplicit3(f,[-5 5 -5 5 -5 -2],'--.','MarkerEdgeColor','g') hold on fimplicit3(f,[-5 5 -5 5 -2 2],'LineWidth',1,'FaceColor','g') fimplicit3(f,[-5 5 -5 5 2 5],'EdgeColor','none')

Plot the implicit surface $1/{x}^{2}-1/{y}^{2}+1/{z}^{2}=0$. Specify an output to make fimplicit3 return the plot object.

syms x y z f = 1/x^2 - 1/y^2 + 1/z^2; fi = fimplicit3(f)

fi = ImplicitFunctionSurface with properties: Function: [1x1 sym] EdgeColor: [0 0 0] LineStyle: '-' FaceColor: 'interp' Show all properties

Show only the positive x-axis by setting the XRange property of fi to [0 5]. Remove the lines by setting the EdgeColor property to 'none'. Visualize the hidden surfaces by making the plot transparent by setting the FaceAlpha property to 0.8.

fi.XRange = [0 5]; fi.EdgeColor = 'none'; fi.FaceAlpha = 0.8;

Control the resolution of an implicit surface plot by using the 'MeshDensity' option. Increasing 'MeshDensity' can make smoother, more accurate plots while decreasing 'MeshDensity' can increase plotting speed.

Divide a figure into two by using subplot. In the first subplot, plot the implicit surface $\mathrm{sin}\left(1/\left(xyz\right)\right)$. The surface has large gaps. Fix this issue by increasing the 'MeshDensity' to 40 in the second subplot. fimplicit3 fills the gaps showing that by increasing 'MeshDensity' you increased the resolution of the plot.

syms x y z f = sin(1/(x*y*z)); subplot(2,1,1) fimplicit3(f) title('Default MeshDensity = 35') subplot(2,1,2) fimplicit3(f,'MeshDensity',40) title('Increased MeshDensity = 40')

Apply rotation and translation to the implicit surface plot of a torus.

A torus can be defined by an implicit equation in Cartesian coordinates as

$\mathit{f}\left(\mathit{x},\mathit{y},\mathit{z}\right)={\left({\mathit{x}}^{2}+{\mathit{y}}^{2}+{\mathit{z}}^{2}+{\mathit{R}}^{2}-{\mathit{a}}^{2}\right)}^{2}-4{\mathit{R}}^{2}\left({\mathit{x}}^{2}+{\mathit{y}}^{2}\right)$

where

• $a$ is the radius of the tube

• $R$ is the distance from the center of the tube to the center of the torus

Define the values for $a$ and $R$ as 1 and 5, respectively. Plot the torus using fimplicit3.

syms x y z a = 1; R = 4; f(x,y,z) = (x^2+y^2+z^2+R^2-a^2)^2 - 4*R^2*(x^2+y^2); fimplicit3(f) hold on

Apply rotation to the torus around the $x$-axis. Define the rotation matrix. Rotate the torus by 90 degrees or $\pi /2$ radians. Shift the center of the torus by 5 along the $x$-axis.

alpha = pi/2; Rx = [1 0 0; 0 cos(alpha) sin(alpha); 0 -sin(alpha) cos(alpha)]; r = [x; y; z]; r_90 = Rx*r; g = subs(f,[x,y,z],[r_90(1)-5,r_90(2),r_90(3)]);

Add a second plot of the rotated and translated torus to the existing graph.

fimplicit3(g) axis([-5 10 -5 10 -5 5]) hold off

## Input Arguments

collapse all

3-D implicit equation or function to plot, specified as a symbolic equation, expression, or function. If an expression or function is specified, then fimplicit3 assumes the right-hand size to be 0.

Plotting interval for x-, y- and z- axes, specified as a vector of two numbers. The default is [-5 5].

Plotting interval for x-, y- and z- axes, specified as a vector of six numbers. The default is [-5 5 -5 5 -5 5].

Axes object. If you do not specify an axes object, then fimplicit3 uses the current axes.

Line style, marker, and color, specified as a character vector or string containing symbols. The symbols can appear in any order. You do not need to specify all three characteristics (line style, marker, and color). For example, if you omit the line style and specify the marker, then the plot shows only the marker and no line.

Example: '--or' is a red dashed line with circle markers

Line StyleDescription
-Solid line
--Dashed line
:Dotted line
-.Dash-dot line
MarkerDescription
'o'Circle
'+'Plus sign
'*'Asterisk
'.'Point
'x'Cross
'_'Horizontal line
'|'Vertical line
's'Square
'd'Diamond
'^'Upward-pointing triangle
'v'Downward-pointing triangle
'>'Right-pointing triangle
'<'Left-pointing triangle
'p'Pentagram
'h'Hexagram
ColorDescription

y

yellow

m

magenta

c

cyan

r

red

g

green

b

blue

w

white

k

black

### Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: 'Marker','o','MarkerFaceColor','red'

The properties listed here are only a subset. For a complete list, see ImplicitFunctionSurface Properties.

Number of evaluation points per direction, specified as a number. The default is 35.

Example: 100

Line color, specified as 'interp', an RGB triplet, a hexadecimal color code, a color name, or a short name. The default RGB triplet value of [0 0 0] corresponds to black. The 'interp' value colors the edges based on the ZData values.

For a custom color, specify an RGB triplet or a hexadecimal color code.

• An RGB triplet is a three-element row vector whose elements specify the intensities of the red, green, and blue components of the color. The intensities must be in the range [0,1]; for example, [0.4 0.6 0.7].

• A hexadecimal color code is a character vector or a string scalar that starts with a hash symbol (#) followed by three or six hexadecimal digits, which can range from 0 to F. The values are not case sensitive. Thus, the color codes '#FF8800', '#ff8800', '#F80', and '#f80' are equivalent.

Alternatively, you can specify some common colors by name. This table lists the named color options, the equivalent RGB triplets, and hexadecimal color codes.

Color NameShort NameRGB TripletHexadecimal Color CodeAppearance
'red''r'[1 0 0]'#FF0000'

'green''g'[0 1 0]'#00FF00'

'blue''b'[0 0 1]'#0000FF'

'cyan' 'c'[0 1 1]'#00FFFF'

'magenta''m'[1 0 1]'#FF00FF'

'yellow''y'[1 1 0]'#FFFF00'

'black''k'[0 0 0]'#000000'

'white''w'[1 1 1]'#FFFFFF'

'none'Not applicableNot applicableNot applicableNo color

Here are the RGB triplets and hexadecimal color codes for the default colors MATLAB® uses in many types of plots.

[0 0.4470 0.7410]'#0072BD'

[0.8500 0.3250 0.0980]'#D95319'

[0.9290 0.6940 0.1250]'#EDB120'

[0.4940 0.1840 0.5560]'#7E2F8E'

[0.4660 0.6740 0.1880]'#77AC30'

[0.3010 0.7450 0.9330]'#4DBEEE'

[0.6350 0.0780 0.1840]'#A2142F'

Line style, specified as one of the options listed in this table.

Line StyleDescriptionResulting Line
'-'Solid line

'--'Dashed line

':'Dotted line

'-.'Dash-dotted line

'none'No lineNo line

Line width, specified as a positive value in points, where 1 point = 1/72 of an inch. If the line has markers, then the line width also affects the marker edges.

The line width cannot be thinner than the width of a pixel. If you set the line width to a value that is less than the width of a pixel on your system, the line displays as one pixel wide.

Marker symbol, specified as one of the values listed in this table. By default, the object does not display markers. Specifying a marker symbol adds markers at each data point or vertex.

ValueDescription
'o'Circle
'+'Plus sign
'*'Asterisk
'.'Point
'x'Cross
'_'Horizontal line
'|'Vertical line
'square' or 's'Square
'diamond' or 'd'Diamond
'^'Upward-pointing triangle
'v'Downward-pointing triangle
'>'Right-pointing triangle
'<'Left-pointing triangle
'pentagram' or 'p'Five-pointed star (pentagram)
'hexagram' or 'h'Six-pointed star (hexagram)
'none'No markers

Marker outline color, specified as 'auto', an RGB triplet, a hexadecimal color code, a color name, or a short name. The default value of 'auto' uses the same color as the EdgeColor property.

For a custom color, specify an RGB triplet or a hexadecimal color code.

• An RGB triplet is a three-element row vector whose elements specify the intensities of the red, green, and blue components of the color. The intensities must be in the range [0,1]; for example, [0.4 0.6 0.7].

• A hexadecimal color code is a character vector or a string scalar that starts with a hash symbol (#) followed by three or six hexadecimal digits, which can range from 0 to F. The values are not case sensitive. Thus, the color codes '#FF8800', '#ff8800', '#F80', and '#f80' are equivalent.

Alternatively, you can specify some common colors by name. This table lists the named color options, the equivalent RGB triplets, and hexadecimal color codes.

Color NameShort NameRGB TripletHexadecimal Color CodeAppearance
'red''r'[1 0 0]'#FF0000'

'green''g'[0 1 0]'#00FF00'

'blue''b'[0 0 1]'#0000FF'

'cyan' 'c'[0 1 1]'#00FFFF'

'magenta''m'[1 0 1]'#FF00FF'

'yellow''y'[1 1 0]'#FFFF00'

'black''k'[0 0 0]'#000000'

'white''w'[1 1 1]'#FFFFFF'

'none'Not applicableNot applicableNot applicableNo color

Here are the RGB triplets and hexadecimal color codes for the default colors MATLAB uses in many types of plots.

[0 0.4470 0.7410]'#0072BD'

[0.8500 0.3250 0.0980]'#D95319'

[0.9290 0.6940 0.1250]'#EDB120'

[0.4940 0.1840 0.5560]'#7E2F8E'

[0.4660 0.6740 0.1880]'#77AC30'

[0.3010 0.7450 0.9330]'#4DBEEE'

[0.6350 0.0780 0.1840]'#A2142F'

Example: [0.5 0.5 0.5]

Example: 'blue'

Example: '#D2F9A7'

Marker fill color, specified as 'auto', an RGB triplet, a hexadecimal color code, a color name, or a short name. The 'auto' value uses the same color as the MarkerEdgeColor property.

For a custom color, specify an RGB triplet or a hexadecimal color code.

• An RGB triplet is a three-element row vector whose elements specify the intensities of the red, green, and blue components of the color. The intensities must be in the range [0,1]; for example, [0.4 0.6 0.7].

• A hexadecimal color code is a character vector or a string scalar that starts with a hash symbol (#) followed by three or six hexadecimal digits, which can range from 0 to F. The values are not case sensitive. Thus, the color codes '#FF8800', '#ff8800', '#F80', and '#f80' are equivalent.

Alternatively, you can specify some common colors by name. This table lists the named color options, the equivalent RGB triplets, and hexadecimal color codes.

Color NameShort NameRGB TripletHexadecimal Color CodeAppearance
'red''r'[1 0 0]'#FF0000'

'green''g'[0 1 0]'#00FF00'

'blue''b'[0 0 1]'#0000FF'

'cyan' 'c'[0 1 1]'#00FFFF'

'magenta''m'[1 0 1]'#FF00FF'

'yellow''y'[1 1 0]'#FFFF00'

'black''k'[0 0 0]'#000000'

'white''w'[1 1 1]'#FFFFFF'

'none'Not applicableNot applicableNot applicableNo color

Here are the RGB triplets and hexadecimal color codes for the default colors MATLAB uses in many types of plots.

[0 0.4470 0.7410]'#0072BD'

[0.8500 0.3250 0.0980]'#D95319'

[0.9290 0.6940 0.1250]'#EDB120'

[0.4940 0.1840 0.5560]'#7E2F8E'

[0.4660 0.6740 0.1880]'#77AC30'

[0.3010 0.7450 0.9330]'#4DBEEE'

[0.6350 0.0780 0.1840]'#A2142F'

Example: [0.3 0.2 0.1]

Example: 'green'

Example: '#D2F9A7'

Marker size, specified as a positive value in points, where 1 point = 1/72 of an inch.

## Output Arguments

collapse all

One or more objects, returned as a scalar or a vector. The object is an implicit function surface object. You can use these objects to query and modify properties of a specific line. For details, see ImplicitFunctionSurface Properties.

## Algorithms

fimplicit3 assigns the symbolic variables in f to the x axis, the y axis, then the z axis, and symvar determines the order of the variables to be assigned. Therefore, variable and axis names might not correspond. To force fimplicit3 to assign x, y, or z to its corresponding axis, create the symbolic function to plot, then pass the symbolic function to fimplicit3.

For example, the following code plots the roots of the implicit function f(x,y,z) = x + z in two ways. The first way forces fimplicit3 to assign x and z to their corresponding axes. In the second way, fimplicit3 defers to symvar to determine variable order and axis assignment: fimplicit3 assigns x and z to the x and y axes, respectively.

syms x y z; f(x,y,z) = x + z; figure; subplot(2,1,1) fimplicit3(f); view(-38,71); subplot(2,1,2) fimplicit3(f(x,y,z)); % Or fimplicit3(x + z);

### Topics

Introduced in R2016b

## Support

#### Mathematical Modeling with Symbolic Math Toolbox

Get examples and videos