# Why e is "natural", and why we use radians.

#### ThePerfectHacker

##### Well-known member
Many books give bad answers or no answers at all to why we work with base $e$ and measure angles according to radians in calculus.

Here is what I tell my students, as far as I know, this is the best explanation I seen because it is essentially a one line explanation that is short and to the point.

Why $e$ is natural: Let $b>0$, $b\not = 1$ and consider the function $f(x) = b^x$. This is an exponential function with base $b$ and we can show that $f'(x) = c\cdot b^x$ where $c$ is some constant. In a similar manner we can consider the function $g(x) = \log_b x$, logarithmic function to base $b$, we can show that $g'(x) = k\cdot x^{-1}$ where $k$ is some constant. It would be best and simplest looking derivative formula if those constants, $b$ and $k$, were both equal to one. This happens exactly when $b=e$. Thus, $e$ is natural base for exponent because the derivative formulas for exponential and logarithmic function are as simple as they can be.

Why radians are natural: A "degree" is defined by declaring a full revolution to be $360^{\circ}$, a "radian" is defined by declaring a full revolution to be $2\pi$ radians. More generally, we can define a new angle measurement by declaring a full revolution to be $R$ (for instance, $R=400$, results in something known as gradians). Let us denote $\sin_R x$ and $\cos_R x$ to be the sine and cosine functions of $x$ measured along $R$-units of angles. It can be shown that $(\sin_R x)' = C\cdot(\cos_R x)$ and $(\cos_R x)' = -C\cdot(\sin_R x)$ where $C$ is some constant. It would be best if this constant can be made $C=1$ which happens precisely when $R=2\pi$.

#### chisigma

##### Well-known member
Many books give bad answers or no answers at all to why we work with base $e$ and measure angles according to radians in calculus.

Here is what I tell my students, as far as I know, this is the best explanation I seen because it is essentially a one line explanation that is short and to the point.

Why $e$ is natural: Let $b>0$, $b\not = 1$ and consider the function $f(x) = b^x$. This is an exponential function with base $b$ and we can show that $f'(x) = c\cdot b^x$ where $c$ is some constant. In a similar manner we can consider the function $g(x) = \log_b x$, logarithmic function to base $b$, we can show that $g'(x) = k\cdot x^{-1}$ where $k$ is some constant. It would be best and simplest looking derivative formula if those constants, $b$ and $k$, were both equal to one. This happens exactly when $b=e$. Thus, $e$ is natural base for exponent because the derivative formulas for exponential and logarithmic function are as simple as they can be.

Why radians are natural: A "degree" is defined by declaring a full revolution to be $360^{\circ}$, a "radian" is defined by declaring a full revolution to be $2\pi$ radians. More generally, we can define a new angle measurement by declaring a full revolution to be $R$ (for instance, $R=400$, results in something known as gradians). Let us denote $\sin_R x$ and $\cos_R x$ to be the sine and cosine functions of $x$ measured along $R$-units of angles. It can be shown that $(\sin_R x)' = C\cdot(\cos_R x)$ and $(\cos_R x)' = -C\cdot(\sin_R x)$ where $C$ is some constant. It would be best if this constant can be made $C=1$ which happens precisely when $R=2\pi$.
Let's suppose to use 'non natural' bases for exponents and angles... in this case probably today the following 'beautiful formula' ...

$\displaystyle e^{i\ \theta} = \cos \theta + i\ \sin \theta\ (1)$

... would be not yet known ...

Kind regards

$\chi$ $\sigma$

#### ThePerfectHacker

##### Well-known member
$\displaystyle e^{i\ \theta} = \cos \theta + i\ \sin \theta\ (1)$

=

$$\pi^{i\theta} = \cos \theta + i\sin \theta$$
Provided that we measure angles with full revolution $2\pi \log \pi$.

So you can still have Euler formula for different bases and angles provided that they match together nicely. But the derivative formulas will change into something ugly.

#### Deveno

##### Well-known member
MHB Math Scholar
Forgive me for being obtuse but your statement:

...consider the function $f(x) = b^x$. This is an exponential function with base $b$...
is completely mystifying to me.

In particular, I mean: how does one define such a function for, say: $b = \sqrt{2}$?

(I know the answer, someone who is taking calculus for the first time probably does NOT.)

In fact, proving the "base laws" for the functions $\log_b$ and $\exp_b$ depends on somehow producing the "natural base", which depends on producing the number $e$. So how do you do this?

If, in fact, you define:

$$\displaystyle e = x \in \Bbb R: \int_1^x \frac{1}{t}\ dt = 1$$

and show that for:

$$\displaystyle F(x) = \int_1^x \frac{1}{t}\ dt$$

$F(a) + F(b) = F(ab)$

I am prepared to believe that (given a proof that $F$ is injective):

$F^{-1}(a+b) = F^{-1}(a)F^{-1}(b)$

and that such a function $F^{-1}$ has all the properties of $b^x$ when $x$ is rational.

It follows (in my mind, anyway) that we have:

$e = F^{-1}(1)$.

This, to me, is the reason why $e$ is "natural", I find the definition:

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

nearly impossible to motivate, whereas the derivative of a differentiable function $f$ where:

$f(a+b) = f(a)f(b)$ clearly has derivative:

$f'(x) = f'(0)\cdot f(x)$.

At this point, we are in a bit of a fix, which is why considering $f^{-1}$ proves to be more amenable to attack:

$(f^{-1})'(x) = \dfrac{1}{f'(f^{-1}(x))} = \dfrac{1}{f'(0)\cdot f(f^{-1}(x))}$

$= \dfrac{1}{f'(0)x}$

This is a function of the form $g(x) = \dfrac{1}{\alpha x}$, and we can use the Fundamental Theorem of Calculus to find values for $f^{-1}(x)$.

Taking $\alpha = 1$ leads, of course, to the above definition of $e$.

Last edited:

#### ThePerfectHacker

##### Well-known member
Forgive me for being obtuse but your statement is completely mystifying to me.
It is not mystifying at all. It is just not rigorous. But that is fine. I doubt that Euler himself thought about it the way we think about it today. And what you wrote will have little value to calculus students. You might as well stop teaching trigonometry with that attitude and define sine and cosine as power series, because that is after all the formal way of doing it, which is how Rudin does it in his book on the first pages.

The important part is to motivate the idea then provide the rigor later. So defining exponentials $b^x$ for arbitrary real numbers is okay because it can at least motivate why $e$ is the best number to choose for $b$.

#### Evgeny.Makarov

##### Well-known member
MHB Math Scholar
In particular, I mean: how does one define such a function for, say: $b = \sqrt{2}$?
I believe, the most natural definition of $\left(\sqrt{2}\right)^a$ is $\lim_{x\to\sqrt{2}}\lim_{y\to a}x^y$ where $x$ and $y$ range over rational numbers.

In fact, proving the "base laws" for the functions $\log_b$ and $\exp_b$ depends on somehow producing the "natural base", which depends on producing the number $e$.
It should be possible to prove $x^{a+b}=x^ax^b$ with the definition above, and this does not require $e$.

#### Deveno

##### Well-known member
MHB Math Scholar
It is not mystifying at all. It is just not rigorous. But that is fine. I doubt that Euler himself thought about it the way we think about it today. And what you wrote will have little value to calculus students. You might as well stop teaching trigonometry with that attitude and define sine and cosine as power series, because that is after all the formal way of doing it, which is how Rudin does it in his book on the first pages.

The important part is to motivate the idea then provide the rigor later. So defining exponentials $b^x$ for arbitrary real numbers is okay because it can at least motivate why $e$ is the best number to choose for $b$.
I'm not sure you understand my point. Let me re-phrase it:

"What does $b^x$ mean for irrational $x$?"

I do not believe rigor is necessary to teach facts, even if the justification cannot be given at that time. It is common for young children to be told that the area of a circle is pi times its radius squared without any justification given. Given the "assumption" that the formula is true, one can still use it profitably, and I see no reason not to under those circumstances.

In a similar vein, I see no problem with teaching the "SOHCAHTOA" approach to trigonometry, either. While that is perfectly adequate for calculating many trig functions of well-established ratios, it is somewhat inadequate for calculating the values of the *continuous* function $\sin(x)$, and when one acquires the mathematical sophistication for a *better* definition, one ought to employ that instead. Power series approximations will do this, but one can use integrals of algebraic functions to obtain inverse trig functions, which also accomplishes the same purpose. A third, and also perfectly acceptable approach, is to use differential equations to define these transcendental functions.

I am not arguing that one *has* to define them this way, just that one *can* and the tools learned in a first-year calculus course allow this. One need not take this path if one feels that the students "aren't ready".

But back to my main point, which I feel is *somewhat* important: how do you define the function:

$f(x) = b^x$

and how do you justify that it is differentiable?

I honestly don't know your answers, but if I was one of your students, I would feel they are pertinent.

I believe, the most natural definition of $\left(\sqrt{2}\right)^a$ is $\lim_{x\to\sqrt{2}}\lim_{y\to a}x^y$ where $x$ and $y$ range over rational numbers.
I'm OK with this. Computing this (without a computer) might prove problematic. This does address continuity satisfactorily, differentiability is another story.

It should be possible to prove $x^{a+b}=x^ax^b$ with the definition above, and this does not require $e$.
I shouldn't think that it would. That is not a "change of base" formula. However, it *is* a good place to start. That said, where does $e$ come in?

#### Evgeny.Makarov

##### Well-known member
MHB Math Scholar
That said, where does $e$ come in?
I agree with the OP that $e$ is such that $\left(e^x\right)'=e^x$.

#### Deveno

##### Well-known member
MHB Math Scholar
I agree with the OP that $e$ is such that $\left(e^x\right)'=e^x$.
I think we all agree this is true. How do you arrive at that fact?

#### Evgeny.Makarov

##### Well-known member
MHB Math Scholar
$e$ is defined to be such constat that $\left(e^x\right)'=e^x$.

Now, I have not looked into the issue of defining $e^x$ for a long time. This is how I believe it was introduced to me, and if this approach works, I would consider it very natural.

#### ThePerfectHacker

##### Well-known member
"What does $b^x$ mean for irrational $x$?"
Exactly what most people think it means. You replace $x$ by a rational number $q$ which is close to $x$ and then compute $b^q$. That is what every student would do if you ask them to find $2^{\pi}$. That is what Euler thought of it and mathematicians back then. So I can write $b^x$ function without rigorously defining it.

and how do you justify that it is differentiable?
I do not. I just write it and then ask students what will the derivative of this function be?

All that stuff you wrote before it useless to make a first time student who sees the natural exponential to understand what makes it special to other exponential functions. He will get lost in the middle and not understand what you are doing it. My approach does not suffer from that. Now if you tell a student the natural exponential is its own derivative while other exponentials are almost their own derivative they see what makes the natural exponent the nicer base to use.

#### Deveno

##### Well-known member
MHB Math Scholar
Let me see if I have this straight: you differentiate a function without any justification that it is differentiable. Why do I think this is not a good idea?

But...granted; establishing that the conditions to apply some of the theorems one uses from elementary calculus might be "more technical stuff" than a given student may need or want. Let's move on.

How does one establish that:

$b^x = e^{x\log(b)}$?

I mean, I'm willing to accept that as a DEFINITION of $b^x$, but then I'd sure like to know what $e$ is.

Now, there is "that other definition" of $e$ (which is actually the first definition I ever encountered), but...

Again, you're asking people to take a lot "on faith". There is nothing wrong with this, per se, but calculus affords an opportunity to actually PROVE things that previously they were only TOLD. This moves the source of their knowledge from: "external authority" (books, teacher, expert in field) to: "internal understanding" (I know it's true because of other things I know are true).

In one view, math is another form of intellectual slavery. In another, it is intellectual freedom. I suppose it's obvious which one I favor.

Let me put this in another light: it is (or so I am arguing) preferable to have things we reason about be on "firm footing" (because arguments based on incorrect assumptions can be invalid, even if the reasoning itself is sound). University students are (by and large) people who have reached the age of majority, and as such are responsible for their own actions. This means (among other things) they will be expected to think for themselves. I feel it is irresponsible in a classroom setting, therefore, to "think what you're told to think is true", as it delays the level of responsibility they will be held to by society.

Engineers, for example, will be held accountable for the safety of structures they design or certify. Not making them aware of the mathematical principles that lay beneath their calculations could conceivably lead to fatalities. If I were an engineer, I would want to be **** certain I had a minimum of assumptions, to limit my own potential liability. If there were a typo in a formula in a handbook of mathematical expressions I had used, it is possible that would not help me much in a civil lawsuit.

Granted, few of your students may face such an extreme situation, and such a situation is even less likely to rest upon a definition of an exponential function. Nevertheless, I believe in rigor as a principle, not for its own sake as a form of intellectual prowess, but because of what it accomplishes: showing what we derive is a consequence of simpler facts.

Ignoring the logical priority of mathematical conclusions is not sound mathematics. It neatly sweeps "hard stuff" under the rug, as a matter of expedience. It's like fast-food convenience for the mind, in short: a sham.

Now, it would be one thing if the Fundamental Theorem of Calculus and the Inverse Function Theorem were "abstract generalities" not bothered with in a beginning calculus course. However, this is not so, and I believe (perhaps I am being "too esoteric" in this belief?) that the best way to understanding something is to become acquainted with it through USE.

So, if we have these tools available to define certain functions: why don't we USE them? ESPECIALLY since transcendental functions are difficult to understand EXCEPT through some form of limiting process (and isn't calculus all about the nifty things we can do with limits?).

I believe that teaching people to think for themselves only after they reach graduate school is "too late". Unless they have already individually acquired the skill on their own independently, they are set-up for failure, or at best, a very difficult time of it.

I do understand, however, that as a matter of pragmatism, you may have found that devoting too much time to these sorts of issues has been non-productive. So, you are passing the buck to some other teacher. One can only hope that somewhere, this comes to an abrupt halt.

**************

I didn't mean to obliterate your cognizant observation that $e$ is indeed a "natural" base. It is, and for the reasons you indicate. However, something "deep" is hiding behind it, something important (a fact about this slippery real number $e$). Transcendental real numbers *ought* to be "hard to define", in fact it took centuries before we were in a position to even conclude they existed (that is, that the algebraic numbers are not "cauchy-closed").

Personally, if all one takes calculus for is to calculate derivatives and integrals, meh: Wolfram|Alpha and a CRC handbook, skip the class. This business about limits and continuity, on the other hand, and the exploration of the "infinitesimal", this sly attempt to touch the face of infinity; if that does not make one blush, I humbly submit one has no soul.

#### ThePerfectHacker

##### Well-known member
Let me see if I have this straight: you differentiate a function without any justification that it is differentiable. Why do I think this is not a good idea?
I only read your first paragraph. I did not read anything else you wrote because I think your teaching standards are abysmal if you have a problem with writing down down $b^x$ in the way that makes sense to most people when they actually think about it.

Historically speaking all the calculus developed in a non-precise way, but it was motivated, and my presentation of it most closely parallels it. Go ahead why not spend the the first two months of class defining Dedekind cuts and what it means to even add two real numbers together. But you do not do that. You say that is too much. So if you are willing to accept that it is okay to teach calculus without defining what addition means, rather appealing to students intuitive feeling about what it is, then why not define exponentials in the most intuitive way possible?

I am willing to bet if you explained to a student why $e$ is natural using my explanation they will have a much better chance of repeating it back to you than your explanation.

#### Deveno

##### Well-known member
MHB Math Scholar
I'm not sure what it is you think I am getting at. It might be a bit more illuminating to read my entire post, if only to provide more context, but I cannot force you to do this.

Not every function is differentiable. Students should not, even if they do not get all the details think this is "mostly true". Continuity is *special* and differentiability even more so.

But again, I do not hear an answer to my original question: assuming, for the time being that $b^x$ *is* differentiable (and we certainly HOPE it would be so), how do you actually differentiate it?

What I imagine is something invoking the chain rule, and writing:

$b^x = e^{x\log(b)} = \exp \circ (x \cdot \log(b))$

and using the product (or multiplying by a constant) rule for the $x \log(b)$ part, and then re-writing:

$(b^x)' = (\exp)'(x \log(b))\cdot \log(b) = \log(b)\cdot b^x$.

To get to that conclusion, we need to know at least these two facts:

1. $(e^x)' = e^x$
2. what the function $\log$ is (in particular that it is a functional *inverse* of $\exp$).

Perhaps you show (or merely indicate the "plausibility" of) the fact that $e^0 = 1$. I would be *interested* in how you derive fact 1. There are some different ways to do this, and you haven't indicated which one you prefer. You also have not indicated how the number $e$ (rather than "some exponential function $\exp$") enters into this. I think that this is critical, since the whole POINT of your initial post is that $e$ represents a "special base".

Fact 2 also needs prior establishment of at least SOME facts about $e^x$ (like, that it is 1-1, so it *has* an inverse, contrast this with the contortions we must undergo for inverse trig functions).

I know that you feel that it is somehow more complicated to start with a way of describing $\log$ and deriving $\exp$ as ITS inverse function, but I really don't see this. The crucial property of $\log$:

$\log(xy) = \log(x) + \log(y)$

is an EASY consequence of the definition:

$$\displaystyle \log(x) = \int_1^x \frac{1}{t}\ dt$$, by taking the interval:

$[1,xy]$ and splitting it into the two sub-intervals of $[1,x]$ and $[x,xy]$, and using the linearity of the integral (presumably you find this property not so challenging as to withhold it from your students).

At least you answered my original question of "what is $b^x$?" by answering it via some kind of "rational approximation". As I indicated to Evgeny, in his reply, I am perfectly OK with that. The real number system was designed to let us do things like that, so that's fair.

How you derive the fact:

$b^x = e^{x\log(b)}$ is a more subtle question. If in fact, you already have the inverse-pair $\exp$ and $\log$ previously established (you don't say if this is true or not), one could use THIS property of (rational, and in approximation, real) exponents:

$(a^b)^c = a^{bc}$.

Perhaps "most" (or even possibly "all") of your students do not care. I cannot change that, nor do I have the singular pleasure of addressing them. I feel you should care, especially since the tone of this thread indicates a pedagogical approach of choosing a "simple case" as desirable.

Historically, the logical foundations of calculus were seen as something of a "crisis", and provided the impetus for some truly worth-while mathematics by Cauchy, Weierstrass, Riemann and Dedekind (to name a few note-worthy examples). The "soundness" of Newton's (and Liebniz's) original justifications were viewed with some suspicion well into the 20th century, although with the advent of "non-standard analysis" these fears have been mostly allayed. Not of all mathematical progress is made at "the outer reaches" sometimes thinking about "the very beginnings" proves fruitful, as well.

If this is not so, then tell me: why do we even "bother" with "epsilon-delta" proofs? I bet even a beginning calculus text makes some (perhaps brief) mention of these strange animals (or so it seems to me with the wealth of questions asked about them on sites such as this one).

Personally, I think talking about Dedekind cuts or Cauchy sequences (or even the oft-maligined "infinite decimal" approach) is a worth-while undertaking, if only to show that these "real numbers" have some "concrete" realization as something we can use rational numbers to approximate (because, underneath it all, the rationals is what we "really" use). I understand if the syllabus you follow does not allow time for this, but it certainly would make "some theorems" less confusing (anything that uses glb's or lub's to establish the existence of some desired real number, for example).

*******************

I do get it, you know, that a "simple" explanation is easier to remember, and that perhaps as much as 80% of what a first-year calculus student learns will be forgotten in 3 months time (unless they *immediately* take a refresher course, or a "building-upon-it" continuation).

If I were a student of yours, asking these same questions, would I get the very same answers?

*******************

I have talked at perhaps too much length about this particular subject. It's hard for me to judge whether this becomes a purely "ad hominem" discussion, so let us abandon it. What I have neglected to say in all of this, is that the SECOND part of your post, is something I WHOLE-HEARTEDLY agree with, and that thinking in terms of "turns" is the "natural" way to measure angle (and very profitable for physicists, and engineers).

#### ThePerfectHacker

##### Well-known member
I'm not sure what it is you think I am getting at. It might be a bit more illuminating to read my entire post, if only to provide more context, but I cannot force you to do this.

Not every function is differentiable. Students should not, even if they do not get all the details think this is "mostly true". Continuity is *special* and differentiability even more so.

But again, I do not hear an answer to my original question: assuming, for the time being that $b^x$ *is* differentiable (and we certainly HOPE it would be so), how do you actually differentiate it?
How do you "prove" that $\sin x$ and $\cos x$ are differenciable? You draw a picture illustrating important limits. That aint a proof at all. However, the picture is more illuminating to understanding the analysis of trigonometric functions than a boring non-inspired unmotivated, but rigorous, power series definition.

How do you "define" $\sqrt{x}$? You have no problem saying that it is that positive number when squared results in $x$. This definition is not exactly rigorous as it assumes the reals has positive square roots. The proof of which requires the completeness property. Something which is never even mentioned in a calculus course at all. You have no problem using that definition at all.

But the moment I write $b^x$ and I say that means raise $b$ to the power of $x$, you suddenly have a problem. You ask how do I even define. I "define" it in the most natural way most people would expect, $b^q$, were $q$ is a rational number approaching $x$. There is nothing natural about writing $\exp(x\log b)$, it is confusing and entirely unmotivated for anyone who sees it for their first time. Now if you applied this standard consistently you will have a problem with how one "defines" $\sin x$ and $\sqrt{x}$. But you do not. You are okay with how it is presented in a calculus class and assume the necessarily properties, including being differenciable, when needed.

In the end you apply selective criticisms and make the concept of exponential functions exponentially more difficult for first-time students because you think it justifies it. Calculus is not supposed to be about justifying analytic concepts. It is supposed to introduce one to them and try to motivate the reasons for why it works and why it is true.

#### Deveno

##### Well-known member
MHB Math Scholar
How do you "prove" that $\sin x$ and $\cos x$ are differenciable? You draw a picture illustrating important limits. That aint a proof at all. However, the picture is more illuminating to understanding the analysis of trigonometric functions than a boring non-inspired unmotivated, but rigorous, power series definition.

How do you "define" $\sqrt{x}$? You have no problem saying that it is that positive number when squared results in $x$. This definition is not exactly rigorous as it assumes the reals has positive square roots. The proof of which requires the completeness property. Something which is never even mentioned in a calculus course at all. You have no problem using that definition at all.

But the moment I write $b^x$ and I say that means raise $b$ to the power of $x$, you suddenly have a problem. You ask how do I even define. I "define" it in the most natural way most people would expect, $b^q$, were $q$ is a rational number approaching $x$. Now if you applied this standard consistently you will have a problem with how one "defines" $\sin x$ and $\sqrt{x}$. But you do not. You are okay with how it is presented in a calculus class and assume the necessarily properties, including being differenciable, when needed.

In the end you apply selective criticisms and make the concept of exponential functions exponentially more difficult for first-time students because you think it justifies it. Calculus is not supposed to be about justifying analytic concepts. It is supposed to introduce one to them and try to motivate the reasons for why it works and why it is true.
I think differentiating trig functions is likewise somewhat thorny. Similar glib use of $\pi$ is made in this case, usually without any justification. Again, a "geometric" limit argument is the usual "first look" approach taken, and this is not out of character with the geometric flavor that much of calculus has.

I think that transcendental functions are "subtler" than many people realize...indeed, that even the completeness property of the reals is a subtle concept. These things are usually "glossed over" in favor of expediency. I remain unconvinced that this is a NECESSARY evil. It's convenient, yes, and perhaps even "motivational" (whatever that means), but the truth is kept "out of view".

Many calculus texts start with the assertion that "they will assume the reader is familiar with the basic properties of real numbers" and dispense with 100 years of deep (and HARD) mathematics in a few words.

Square roots are a bit thorny, as well. Many students know (or have at least seen a proof) that $\sqrt{2}$ is irrational, but they have no idea what a big can of worms that really is. It is easy to write $\sqrt{x}$ and think you know what it means. I'm sure it comes as a shock to some math majors when they realize that actually, they do NOT (and maybe non-math-majors who never take anything more demanding than calculus ever realize there is "more to it than that").

I believe in DEMONSTRATING that a function is differentiable, by showing the limit that defines its derivative EXISTS. I think this is good "practice" for later when one encounters a function whose differentiability status is unknown. Not all "real problems" have answer keys in the back of some book.

Of course, you have me at a disadvantage: you know your students, and I do not. I ask you for an explanation of what you mean in your original post, and you reply with remarks about "selective criticisms".

I cannot recall the particular thread, but there was a similar discussion some time back about defining the area of a circle, and arriving at a value for $\pi$. Some argued that a "proper definition" of trig functions would have to be delayed until after power series, as that was logically more satisfiying. I made the point that it could be done with the tools of integral calculus (although this might not be very "direct").

One often sees T-shirts with:

$e^{i\pi} + 1 = 0$

printed on them. The simplicity of this formula belies the depth of information it summarizes: how the circle ties together exponentials, logarithms, trigonometry, and an intrinsic notion of distance in 7 scant symbols. I'm not even confident I understand entirely everything it says...but the small portion I DO get, fills me with a kind of awe.

If, in the final analysis, you feel that I am looking "too deeply" at what you think should be taken more lightly, I have no ready answer. I have my reasons for thinking the way I do, but if my explanations are not sufficient, I suppose that is my failing. I *try* to be clear, but I have no assurances I ever am, for I only see the world with my own perceptions, and never that of another human being.

Indeed, I often fear I might be embarrassing my comrades here at MHB, for being too outspoken, or having views well outside of the conventional wisdom, or even worse, perhaps just plain being wrong. I have only a vague notion of INTERNAL consistency to guide me, and I find it enormously difficult to communicate this to other people. Surely, I reason to myself, Evgeny.Makarov or Ackbach or Jameson or MarkFL or chisigma (or some other soul who I have in my ignorance failed to mention) will point out to me what is wrong with my views, so I may improve my ability to express math to other people...but alas, I hear only silence.


# dsolve

Solve system of differential equations

Support for character vector or string inputs will be removed in a future release. Instead, use syms to declare variables and replace inputs such as dsolve('Dy = -3*y') with syms y(t); dsolve(diff(y,t) == -3*y).

## Description

example

S = dsolve(eqn) solves the differential equation eqn, where eqn is a symbolic equation. Use diff and == to represent differential equations. For example, diff(y,x) == y represents the equation dy/dx = y. Solve a system of differential equations by specifying eqn as a vector of those equations.

example

S = dsolve(eqn,cond) solves eqn with the initial or boundary condition cond.

example

S = dsolve(___,Name,Value) uses additional options specified by one or more Name,Value pair arguments.

example

[y1,...,yN] = dsolve(___) assigns the solutions to the variables y1,...,yN.

## Examples

collapse all

Solve the first-order differential equation $\frac{\mathit{dy}}{\mathit{dt}}=\mathit{ay}$.

Specify the first-order derivative by using diff and the equation by using ==. Then, solve the equation by using dsolve.

syms y(t) a
eqn = diff(y,t) == a*y;
S = dsolve(eqn)
S = ${C}_{1} {\mathrm{e}}^{a t}$

The solution includes a constant. To eliminate constants, see Solve Differential Equations with Conditions. For a full workflow, see Solving Partial Differential Equations.

Solve the second-order differential equation $\frac{{\mathit{d}}^{2}\mathit{y}}{{\mathit{dt}}^{2}}=\mathit{ay}$.

Specify the second-order derivative of y by using diff(y,t,2) and the equation by using ==. Then, solve the equation by using dsolve.

syms y(t) a
eqn = diff(y,t,2) == a*y;
ySol(t) = dsolve(eqn)
ySol(t) = ${C}_{1} {\mathrm{e}}^{-\sqrt{a} t}+{C}_{2} {\mathrm{e}}^{\sqrt{a} t}$

Solve the first-order differential equation $\frac{\mathit{dy}}{\mathit{dt}}=\mathit{ay}$ with the initial condition $y\left(0\right)=5$.

Specify the initial condition as the second input to dsolve by using the == operator. Specifying condition eliminates arbitrary constants, such as C1, C2, ..., from the solution.

syms y(t) a
eqn = diff(y,t) == a*y;
cond = y(0) == 5;
ySol(t) = dsolve(eqn,cond)
ySol(t) = $5 {\mathrm{e}}^{a t}$

Next, solve the second-order differential equation $\frac{{\mathit{d}}^{2}\mathit{y}}{{\mathit{dt}}^{2}}={\mathit{a}}^{2}\mathit{y}$ with the initial conditions $y\left(0\right)=b$ and ${y}^{\prime }\left(0\right)=1$.

Specify the second initial condition by assigning diff(y,t) to Dy and then using Dy(0) == 1.

syms y(t) a b
eqn = diff(y,t,2) == a^2*y;
Dy = diff(y,t);
cond = [y(0)==b, Dy(0)==1];
ySol(t) = dsolve(eqn,cond)
ySol(t) =

$\frac{{\mathrm{e}}^{a t} \left(a b+1\right)}{2 a}+\frac{{\mathrm{e}}^{-a t} \left(a b-1\right)}{2 a}$

This second-order differential equation has two specified conditions, so constants are eliminated from the solution. In general, to eliminate constants from the solution, the number of conditions must equal the order of the equation.

Solve the system of differential equations

$\begin{array}{l}\frac{\mathit{dy}}{\mathit{dt}}=\mathit{z}\\ \frac{\mathit{dz}}{\mathit{dt}}=-\mathit{y}.\end{array}$

Specify the system of equations as a vector. dsolve returns a structure containing the solutions.

syms y(t) z(t)
eqns = [diff(y,t) == z, diff(z,t) == -y];
S = dsolve(eqns)
S = struct with fields:
z: C2*cos(t) - C1*sin(t)
y: C1*cos(t) + C2*sin(t)

Access the solutions by addressing the elements of the structure.

ySol(t) = S.y
ySol(t) = ${C}_{1} \mathrm{cos}\left(t\right)+{C}_{2} \mathrm{sin}\left(t\right)$
zSol(t) = S.z
zSol(t) = ${C}_{2} \mathrm{cos}\left(t\right)-{C}_{1} \mathrm{sin}\left(t\right)$

When solving for multiple functions, dsolve returns a structure by default. Alternatively, you can assign solutions to functions or variables directly by explicitly specifying the outputs as a vector. dsolve sorts the outputs in alphabetical order using symvar.

Solve a system of differential equations and assign the outputs to functions.

syms y(t) z(t)
eqns = [diff(y,t)==z, diff(z,t)==-y];
[ySol(t),zSol(t)] = dsolve(eqns)
ySol(t) = ${C}_{1} \mathrm{cos}\left(t\right)+{C}_{2} \mathrm{sin}\left(t\right)$
zSol(t) = ${C}_{2} \mathrm{cos}\left(t\right)-{C}_{1} \mathrm{sin}\left(t\right)$

Solve the differential equation $\frac{\partial }{\partial t}y\left(t\right)={e}^{-y\left(t\right)}+y\left(t\right)$. dsolve returns an explicit solution in terms of a Lambert W function that has a constant value.

syms y(t)
eqn = diff(y) == y+exp(-y)
eqn(t) =

sol = dsolve(eqn)
sol = ${\mathrm{W}\text{lambertw}}_{0}\left(-1\right)$

To return implicit solutions of the differential equation, set the 'Implicit' option to true. An implicit solution has the form $F\left(y\left(t\right)\right)=g\left(t\right)$.

sol = dsolve(eqn,'Implicit',true)
sol =

$\left(\begin{array}{c}\left({\int \frac{{\mathrm{e}}^{y}}{y {\mathrm{e}}^{y}+1}\mathrm{d}y|}_{y=y\left(t\right)}\right)={C}_{1}+t\\ {\mathrm{e}}^{-y\left(t\right)} \left({\mathrm{e}}^{y\left(t\right)} y\left(t\right)+1\right)=0\end{array}\right)$

If dsolve cannot find an explicit solution of a differential equation analytically, then it returns an empty symbolic array. You can solve the differential equation by using MATLAB® numerical solver, such as ode45. For more information, see Solve a Second-Order Differential Equation Numerically.

syms y(x)
eqn = diff(y) == (x-exp(-x))/(y(x)+exp(y(x)));
S = dsolve(eqn)
Warning: Unable to find symbolic solution.

S =

[ empty sym ]

Alternatively, you can try finding an implicit solution of the differential equation by specifying the 'Implicit' option to true. An implicit solution has the form $F\left(y\left(x\right)\right)=g\left(x\right)$.

S = dsolve(eqn,'Implicit',true)
S =

${\mathrm{e}}^{y\left(x\right)}+\frac{{y\left(x\right)}^{2}}{2}={C}_{1}+{\mathrm{e}}^{-x}+\frac{{x}^{2}}{2}$

Solve the differential equation $\frac{\mathit{dy}}{\mathit{dt}}=\frac{\mathit{a}}{\sqrt{\mathit{y}}}+\mathit{y}$ with condition $y\left(a\right)=1$. By default, dsolve applies simplifications that are not generally correct, but produce simpler solutions. For more details, see Algorithms.

syms a y(t)
eqn = diff(y) == a/sqrt(y) + y;
cond = y(a) == 1;
ySimplified = dsolve(eqn, cond)
ySimplified =

${\left({\mathrm{e}}^{\frac{3 t}{2}-\frac{3 a}{2}+\mathrm{log}\left(a+1\right)}-a\right)}^{2/3}$

To return the solutions that include all possible values of the parameter $a$, turn off simplifications by setting 'IgnoreAnalyticConstraints' to false.

yNotSimplified = dsolve(eqn,cond,'IgnoreAnalyticConstraints',false)
yNotSimplified =

Solve the second-order differential equation $\left({x}^{2}-1{\right)}^{2}\frac{{\partial }^{2}}{\partial {x}^{2}}y\left(x\right)+\left(x+1\right)\frac{\partial }{\partial x}y\left(x\right)-y\left(x\right)=0$. dsolve returns a solution that contains a term with unevaluated integral.

syms y(x)
eqn = (x^2-1)^2*diff(y,2) + (x+1)*diff(y) - y == 0;
S = dsolve(eqn)
S =

${C}_{2} \left(x+1\right)+{C}_{1} \left(x+1\right) \int \frac{{\mathrm{e}}^{\frac{1}{2 \left(x-1\right)}} {\left(1-x\right)}^{1/4}}{{\left(x+1\right)}^{9/4}}\mathrm{d}x$

To return series solutions of the differential equation around $x=-1$, set the 'ExpansionPoint' to -1. dsolve returns two linearly independent solutions in terms of a Puiseux series expansion.

S = dsolve(eqn,'ExpansionPoint',-1)
S =

$\left(\begin{array}{c}x+1\\ \frac{1}{{\left(x+1\right)}^{1/4}}-\frac{5 {\left(x+1\right)}^{3/4}}{4}+\frac{5 {\left(x+1\right)}^{7/4}}{48}+\frac{5 {\left(x+1\right)}^{11/4}}{336}+\frac{115 {\left(x+1\right)}^{15/4}}{33792}+\frac{169 {\left(x+1\right)}^{19/4}}{184320}\end{array}\right)$

Find other series solutions around the expansion point $\infty$ by setting 'ExpansionPoint' to Inf.

S = dsolve(eqn,'ExpansionPoint',Inf)
S =

$\left(\begin{array}{c}x-\frac{1}{6 {x}^{2}}-\frac{1}{8 {x}^{4}}\\ \frac{1}{6 {x}^{2}}+\frac{1}{8 {x}^{4}}+\frac{1}{90 {x}^{5}}+1\end{array}\right)$

The default truncation order of the series expansion is 6. To obtain more terms in the Puiseux series solutions, set 'Order' to 8.

S = dsolve(eqn,'ExpansionPoint',Inf,'Order',8)
S =

$\left(\begin{array}{c}x-\frac{1}{6 {x}^{2}}-\frac{1}{8 {x}^{4}}-\frac{1}{90 {x}^{5}}-\frac{37}{336 {x}^{6}}\\ \frac{1}{6 {x}^{2}}+\frac{1}{8 {x}^{4}}+\frac{1}{90 {x}^{5}}+\frac{37}{336 {x}^{6}}+\frac{37}{1680 {x}^{7}}+1\end{array}\right)$

Solve the differential equation $\frac{\mathit{dy}}{\mathit{dx}}=\frac{1}{{\mathit{x}}^{2}}{\mathit{e}}^{-\frac{1}{\mathit{x}}}$ without specifying the initial condition.

syms y(x)
eqn = diff(y) == exp(-1/x)/x^2;
ySol(x) = dsolve(eqn)
ySol(x) =

${C}_{1}+{\mathrm{e}}^{-\frac{1}{x}}$

To eliminate constants from the solution, specify the initial condition $\mathit{y}\left(0\right)=1$.

cond = y(0) == 1;
S = dsolve(eqn,cond)
S =

${\mathrm{e}}^{-\frac{1}{x}}+1$

The function ${\mathit{e}}^{-\frac{1}{\mathit{x}}}$ in the solution ySol(x) has different one-sided limits at $x=0$. The function has a right-side limit, $\underset{\mathit{x}\to {0}^{+}}{\mathrm{lim}}\text{\hspace{0.17em}}{\mathit{e}}^{-\frac{1}{\mathit{x}}}=0$, but it has undefined left-side limit, $\underset{\mathit{x}\to {0}^{-}}{\mathrm{lim}}\text{\hspace{0.17em}}{\mathit{e}}^{-\frac{1}{\mathit{x}}}=\infty$.

When you specify the condition y(x0) for a function with different one-sided limits at x0, dsolve treats the condition as a limit from the right, $\mathrm{lim}\text{\hspace{0.17em}}\mathit{x}\to {\mathit{x}}_{0}^{+}$.

## Input Arguments

collapse all

Differential equation or system of equations, specified as a symbolic equation or a vector of symbolic equations. Specify a differential equation by using the == operator. If eqn is a symbolic expression (without the right side), the solver assumes that the right side is 0, and solves the equation eqn == 0.

In the equation, represent differentiation by using diff. For example, diff(y,x) differentiates the symbolic function y(x) with respect to x. Create the symbolic function y(x) by using syms and solve the equation d2y(x)/dx2 = x*y(x) using dsolve.

syms y(x)
S = dsolve(diff(y,x,2) == x*y)

Specify a system of differential equations by using a vector of equations, as in syms y(t) z(t); S = dsolve([diff(y,t) == z, diff(z,t) == -y]). Here, y and z must be symbolic functions that depend on symbolic variables, which are t in this case. The right side must be symbolic expressions that depend on t, y and z. Note that Symbolic Math Toolbox™ currently does not support composite symbolic functions, that is, symbolic functions that depend on another symbolic functions.

Initial or boundary condition, specified as a symbolic equation or vector of symbolic equations.

When a condition contains a derivative, represent the derivative with diff. Assign the diff call to a variable and use the variable to specify the condition. For example, see Solve Differential Equations with Conditions.

Specify multiple conditions by using a vector of equations. If the number of conditions is less than the number of dependent variables, the solutions contain the arbitrary constants C1, C2,....

### Name-Value 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: 'IgnoreAnalyticConstraints',false does not apply internal simplifications.

Expansion point of a Puiseux series solution, specified as a number, or a symbolic number, variable, function, or expression. Specifying this option returns the solution of a differential equation in terms of a Puiseux series (a power series that allows negative and fractional exponents). The expansion point cannot depend on the series variable. For example, see Find Series Solution of Differential Equation.

Data Types: single | double | sym
Complex Number Support: Yes

Option to use internal simplifications, specified as true or false.

By default, the solver applies simplifications while solving the differential equation, which could lead to results not generally valid. In other words, this option applies mathematical identities that are convenient, but the results might not hold for all possible values of the variables. Therefore, by default, the solver does not guarantee the completeness of results. If 'IgnoreAnalyticConstraints' is true, always verify results returned by the dsolve function. For more details, see Algorithms.

To solve ordinary differential equations without these simplifications, set 'IgnoreAnalyticConstraints' to false. Results obtained with 'IgnoreAnalyticConstraints' set to false are correct for all values of the arguments. For certain equations, dsolve might not return an explicit solution if you set 'IgnoreAnalyticConstraints' to false.

Option to return an implicit solution, specified as false or true. For a differential equation with variables x and y(x), an implicit solution has the form F(y(x)) = g(x).

By default, the solver tries to find an explicit solution y(x) = f(x) analytically when solving a differential equation. If dsolve cannot find an explicit solution, then you can try finding a solution in implicit form by specifying the 'Implicit' option to true.

Maximum degree of polynomial equations for which the solver uses explicit formulas, specified as a positive integer smaller than 5. dsolve does not use explicit formulas when solving polynomial equations of degrees larger than 'MaxDegree'.

Truncation order of a Puiseux series solution, specified as a positive integer or a symbolic positive integer. Specifying this option returns the solution of a differential equation in terms of a Puiseux series (a power series that allow negative and fractional exponents). The truncation order n is the exponent in the O-term: $O\left({\mathrm{var}}^{n}\right)$ or $O\left({\mathrm{var}}^{-n}\right)$.

## Output Arguments

collapse all

Solutions of differential equation, returned as a symbolic expression or a vector of symbolic expressions. The size of S is the number of solutions.

Variables storing solutions of differential equations, returned as a vector of symbolic variables. The number of output variables must equal the number of dependent variables in a system of equations. dsolve sorts the dependent variables alphabetically, and then assigns the solutions for the variables to output variables or symbolic arrays.

## Tips

• If dsolve cannot find an explicit or implicit solution, then it issues a warning and returns the empty sym. In this case, try to find a numeric solution using the MATLAB® ode23 or ode45 function. Sometimes, the output is an equivalent lower-order differential equation or an integral.

• dsolve does not always return complete solutions even if 'IgnoreAnalyticConstraints' is false.

• If dsolve returns a function that has different one-sided limits at x0 and you specify the condition y(x0), then dsolve treats the condition as a limit from the right, .

## Algorithms

If you do not set 'IgnoreAnalyticConstraints' to false, then dsolve applies these rules while solving the equation:

• log(a) + log(b) = log(a·b) for all values of a and b. In particular, the following equality is applied for all values of a, b, and c:

(a·b)c = ac·bc.

• log(ab) = b·log(a) for all values of a and b. In particular, the following equality is applied for all values of a, b, and c:

(ab)c = ab·c.

• If f and g are standard mathematical functions and f(g(x)) = x for all small positive numbers, f(g(x)) = x is assumed to be valid for all complex x. In particular:

• log(ex) = x

• asin(sin(x)) = x, acos(cos(x)) = x, atan(tan(x)) = x

• asinh(sinh(x)) = x, acosh(cosh(x)) = x, atanh(tanh(x)) = x

• Wk(x·ex) = x for all branch indices k of the Lambert W function.

• The solver can multiply both sides of an equation by any expression except 0.

• The solutions of polynomial equations must be complete.

## Compatibility Considerations

expand all

Warns starting in R2019b


# Proving right angle using vectors

Let $$ABCD$$ be a rectangle, $$E$$ midpoint of $$\overline{DC}$$ and $$G$$ point on $$\overline{AC}$$ such that $$\vec{BG}$$ is perpendicular to $$\vec{AC}$$. Also, let $$F$$ be a midpoint of $$\overline{AG}$$. Prove that angle $$\angle BFE =\pi/2$$.

So, I need to prove that $$\vec{EF}\cdot \vec{FB}=0$$. I tried to just express these vectors as sums of vectors of rectangle but haven't find any "elegant" way to prove it.

I did found one "ugly" way to prove it:

Let $$|AB|=a$$, $$|AD|=b$$ and $$\vec{AB}=\vec{a}$$, $$\vec{AD}=\vec{b}$$, so $$\vec{AC}=\vec{a}+\vec{b}$$ and since $$\vec{a}\cdot\vec{b}=0$$ we have $$|AC|^2=a^2+b^2$$. We can see that $$\triangle ABC$$ and $$\triangle BCG$$ are similar so $$|CG|=|CB|^2/|AC|$$ and since $$\vec{CG}=\lambda \cdot \vec{CA}$$ we get $$\lambda=\frac{b^2}{a^2+b^2}.$$

Now, we can express $$\vec{EF}$$ and $$\vec{FB}$$ in the terms of $$\vec{a}$$, $$\vec{b}$$, more precisely: $$\vec{EF}=\frac{1}{2}\left(\frac{-b^2}{a^2+b^2}\right)\vec{a}+\frac{1}{2}\left(\frac{a^2}{a^2+b^2}-2\right)\vec{b}$$ and $$\vec{FB}=\frac{1}{2}\left(2-\frac{a^2}{a^2+b^2}\right)\vec{a}+\frac{1}{2}\left(\frac{-a^2}{a^2+b^2}\right)\vec{b}$$ and if we multiply we get that dot product is $$0$$.

But as you can see, this $$\lambda$$ is "weird" and I am wondering if someone sees a more elegant way to prove this ?

• Actually, if you write those final coefficients in terms of $\lambda$, it makes the proof of orthogonality much prettier. – J.G. Oct 9 '18 at 19:26

You can simplify and generalize at the same time.

Instead of defining $$E$$ and $$F$$ as midpoints, define them as weighted averages:

$$E=kC+(1-k)D$$ $$F=kG+(1-k)A$$

(In your question $$k=1/2.)$$ As $$k$$ goes from $$0$$ to $$1$$, $$\triangle{BFE}$$ interpolates the similar triangles $$\triangle{BAD}$$ and $$\triangle{BGC}$$. And it is also similar to these two triangles.

Given that $$(B-G)\cdot(C-G)=0$$ and $$(B-A)\cdot(D-A)=0$$, you can show that $$(B-F)\cdot(E-F)=0$$ (the simplification is a bit tedious, and I used the fact that $$(Rx)\cdot y+(Ry)\cdot x=0$$ for perpendicular vectors $$x,y$$ and rotation $$R$$).

More about the phenomenon of linearly interpolating two directly similar figures can be found by Googling the terms 'spiral similarity' and 'fundamental theorem of directly similar figures'. Also, instead of using vectors you can use complex numbers, as shown in $$\textbf{2.2}$$ of Zachary Abel's Mean Geometry paper.

Let $$H$$ be a midpoint of $$BG$$. Then $$HF$$ is a middle line in triangle $$ABG$$, so $$FH||AB||CD$$ and $$FH = {1\over 2}AB = CE$$ so $$FHCE$$ is a parallelogram, so $$FE||CH$$.

Now $$HF\bot BC$$ so $$HF$$ is (second) altitude in $$\triangle BCF$$ so $$H$$ is orthocenter in this triangle, since $$BG$$ is also altitude in this triangle. So line $$CH\bot FB$$ and thus $$\angle BFE = 90^{\circ}$$.

Here is a vector solution:

Let $$G$$ be an origin of position vecotors. Then $$G=0$$, $$F = A/2$$, $$D = A-B+C$$, $$A\cdot B = C\cdot B=0$$ and $$E = {1\over 2}(C+D) = {1\over 2}(A-B+2C)$$

$$\begin{eqnarray} \vec{FB}\cdot \vec{FE} &=& (E-F)(B-F)\\ &=& {1\over 4}(-B+2C)(2B-A)\\ &=& -{1\over 2}(B^2+CA)\\ &=&0 \end{eqnarray}$$

A solution with a help of the coordinate system.

Let $$B = (0,0)$$, $$C= (2c,0)$$ and $$A= (0,2a)$$. Then $$D(2c,2a)$$ and $$E(2c,a)$$. A perpendicular to $$AC:\;\;{x\over 2c}+{y\over 2a}=1$$ through $$B$$ is $$y={c\over a}x$$ which cuts $$AC$$ at $$G= \big({2a^2c\over a^2+c^2},{2c^2a\over a^2+c^2} \big)$$

so $$F = \big({a^2c\over a^2+c^2},{2c^2a+a^3\over a^2+c^2} \big)$$

Now it is not difficult to see that $$\vec{FE}\cdot \vec{FB} =0$$.

Another solution:

Say $$M$$ is midpoint of $$AB$$, then $$FM$$ is a middle line in triangle $$ABG$$ so $$FM||BG$$ so $$\angle MFC = 90^{\circ}$$ and thus $$F$$ is on a circle through $$B,C$$ and $$M$$. But on this circle is also $$E$$ since $$\angle MEC = 90^{\circ}$$. So $$\angle BFE = \angle BME = 90^{\circ}$$

Alternatively Say $$AB = 2a$$ and $$BC= b$$, then $$AF = {1\over 2}AG = {1\over 2} {4a^2\over \sqrt{4a^2+b^2}} = {2a^2\over \sqrt{4a^2+b^2}}$$ Then we have $$AF\cdot AC = {2a^2\over \sqrt{4a^2+b^2}}\cdot \sqrt{4a^2+b^2} = 2a^2 = AM\cdot AB$$ and so $$B,C,F,M$$ are concylic.


## Solve Algebraic Equation

Symbolic Math Toolbox™ offers both symbolic and numeric equation solvers. This topic shows you how to solve an equation symbolically using the symbolic solver solve. To compare symbolic and numeric solvers, see Select Numeric or Symbolic Solver.

### Solve an Equation

If eqn is an equation, solve(eqn, x) solves eqn for the symbolic variable x.

Use the == operator to specify the familiar quadratic equation and solve it using solve.

syms a b c x
eqn = a*x^2 + b*x + c == 0;
solx = solve(eqn, x)
solx =
-(b + (b^2 - 4*a*c)^(1/2))/(2*a)
-(b - (b^2 - 4*a*c)^(1/2))/(2*a)

solx is a symbolic vector containing the two solutions of the quadratic equation. If the input eqn is an expression and not an equation, solve solves the equation eqn == 0.

To solve for a variable other than x, specify that variable instead. For example, solve eqn for b.

solb = solve(eqn, b)
solb =
-(a*x^2 + c)/x

If you do not specify a variable, solve uses symvar to select the variable to solve for. For example, solve(eqn) solves eqn for x.

### Return the Full Solution to an Equation

solve does not automatically return all solutions of an equation. Solve the equation cos(x) == -sin(x). The solve function returns one of many solutions.

syms x
solx = solve(cos(x) == -sin(x), x)
solx =
-pi/4

To return all solutions along with the parameters in the solution and the conditions on the solution, set the ReturnConditions option to true. Solve the same equation for the full solution. Provide three output variables: for the solution to x, for the parameters in the solution, and for the conditions on the solution.

syms x
[solx, param, cond] = solve(cos(x) == -sin(x), x, 'ReturnConditions', true)
solx =
pi*k - pi/4
param =
k
cond =
in(k, 'integer')

solx contains the solution for x, which is pi*k - pi/4. The param variable specifies the parameter in the solution, which is k. The cond variable specifies the condition in(k, 'integer') on the solution, which means k must be an integer. Thus, solve returns a periodic solution starting at pi/4 which repeats at intervals of pi*k, where k is an integer.

### Work with the Full Solution, Parameters, and Conditions Returned by solve

You can use the solutions, parameters, and conditions returned by solve to find solutions within an interval or under additional conditions.

To find values of x in the interval -2*pi<x<2*pi, solve solx for k within that interval under the condition cond. Assume the condition cond using assume.

assume(cond)
solk = solve(-2*pi<solx, solx<2*pi, param)
solk =
-1
0
1
2

To find values of x corresponding to these values of k, use subs to substitute for k in solx.

xvalues = subs(solx, solk)
xvalues =
-(5*pi)/4
-pi/4
(3*pi)/4
(7*pi)/4

To convert these symbolic values into numeric values for use in numeric calculations, use vpa.

xvalues = vpa(xvalues)
xvalues =
-3.9269908169872415480783042290994
-0.78539816339744830961566084581988
2.3561944901923449288469825374596
5.4977871437821381673096259207391

### Visualize and Plot Solutions Returned by solve

The previous sections used solve to solve the equation cos(x) == -sin(x). The solution to this equation can be visualized using plotting functions such as fplot and scatter.

Plot both sides of equation cos(x) == -sin(x).

fplot(cos(x))
hold on
grid on
fplot(-sin(x))
title('Both sides of equation cos(x) = -sin(x)')
legend('cos(x)','-sin(x)','Location','best','AutoUpdate','off')

Calculate the values of the functions at the values of x, and superimpose the solutions as points using scatter.

yvalues = cos(xvalues)
yvalues =

$\left(\begin{array}{c}-0.70710678118654752440084436210485\\ 0.70710678118654752440084436210485\\ -0.70710678118654752440084436210485\\ 0.70710678118654752440084436210485\end{array}\right)$

scatter(xvalues, yvalues)

As expected, the solutions appear at the intersection of the two plots.

### Simplify Complicated Results and Improve Performance

If results look complicated, solve is stuck, or if you want to improve performance, see, Troubleshoot Equation Solutions from solve Function.

## Support

#### Mathematical Modeling with Symbolic Math Toolbox

Get examples and videos


1. ## Find the limit

Limit as n approaches infinity [(3^n + 5^n)/(3^n+1 + 5^n+1)]

I tried to divide the numerator and denominator by 3^n. Was not successful.

What should I do next?

2. Originally Posted by Nichelle14
Limit as n approaches infinity [(3^n + 5^n)/(3^n+1 + 5^n+1)]

I tried to divide the numerator and denominator by 3^n. Was not successful.

What should I do next?
Did you consider to divide by $3^n+5^n$
Thus,
$\frac{1}{1+\frac{2}{3^n+5^n}}\to 1$ as $n\to\infty$

3. Also,
$1-\frac{1}{n}\leq \frac{3^n+5^n}{3^n+1+5^n+1} \leq 1+\frac{1}{n}$
Since,
$\lim_{n\to\infty} 1-\frac{1}{n}=\lim_{n\to\infty}1+\frac{1}{n}=1$
Thus,
$\lim_{n\to\infty}\frac{3^n+5^n}{3^n+1+5^n+1}=1$ by the squeeze theorem.

4. Hello, Nichelle14!

$\lim_{n\to\infty}\frac{3^n + 5^n}{3^{n+1} + 5^{n+1}}$

I tried to divide the numerator and denominator by $3^n$ . . .Was not successful.

What should I do next?

Divide top and bottom by $5^{n+1}.$

The numerator is: . $\frac{3^n}{5^{n+1}} + \frac{5^n}{5^{n+1}} \;= \;\frac{1}{5}\cdot\frac{3^n}{5^n} + \frac{1}{5}\;=$ $\frac{1}{5}\left(\frac{3}{5}\right)^n + \frac{1}{5}$

The denominator is: . $\frac{3^{n+1}}{5^{n+1}} + \frac{5^{n+1}}{5^{n+1}} \;=\;\left(\frac{3}{5}\right)^{n+1} + 1$

Recall that: if $|a| < 1$, then $\lim_{n\to\infty} a^n\:=\:0$

Therefore, the limit is: . $\lim_{n\to\infty}\,\frac{\frac{1}{5}\left(\frac{3} {5}\right)^n + \frac{1}{5}} {\left(\frac{3}{5}\right)^n + 1} \;=\;\frac{\frac{1}{5}\cdot0 + \frac{1}{5}}{0 + 1}\;=\;\frac{1}{5}
$

5. Originally Posted by Soroban
Hello, Nichelle14!

Divide top and bottom by $5^{n+1}.$

The numerator is: . $\frac{3^n}{5^{n+1}} + \frac{5^n}{5^{n+1}} \;= \;\frac{1}{5}\cdot\frac{3^n}{5^n} + \frac{1}{5}\;=$ $\frac{1}{5}\left(\frac{3}{5}\right)^n + \frac{1}{5}$

The denominator is: . $\frac{3^{n+1}}{5^{n+1}} + \frac{5^{n+1}}{5^{n+1}} \;=\;\left(\frac{3}{5}\right)^{n+1} + 1$

Recall that: if $|a| < 1$, then $\lim_{n\to\infty} a^n\:=\:0$

Therefore, the limit is: . $\lim_{n\to\infty}\,\frac{\frac{1}{5}\left(\frac{3} {5}\right)^n + \frac{1}{5}} {\left(\frac{3}{5}\right)^n + 1} \;=\;\frac{\frac{1}{5}\cdot0 + \frac{1}{5}}{0 + 1}\;=\;\frac{1}{5}
$

I think the trick here is that you will divide all the terms by the largest term in the expression(it is useful when the limit tends to infinity)

Keep Smiling
Malay


# Spatial Co-ordinate of Maximum Value of Variable

Say I have the following code:

int nn = 50;
mesh Th = square(nn, nn);
fespace Vh(Th, P1);
Vh u;
u = sin(x);

I can get the maximum value of ‘u’ by:
real maxValueU = u[].max;

How do I get the values of x and y coordinates where maximum value of ‘u’ occurs?

yes but be careful because the max could be not unique.unc

the method imax give the dof number

int dofmaxValueU = u[].imax;

Now for P1 finite element the dof are vertices with same numbering so

Th(dofmaxValueU).x
Th(dofmaxValueU).y

given the coordinate.


# Fixed Cost & Cost Per Person

1. Jul 10, 2017

### zak100

1. The problem statement, all variables and given/known data
A group can charter a particular aircraft at a fixed total cost. If 36 people charter the aircraft rather than 40 people, then the cost per person is greater by 12$a) What is the fixed total cost to charter the aircraft? b) What is the cost per person if 40 people charter the aircraft? 2. Relevant equations ThirtySixCost = 36 * (costPerPerson + 12) FixedCost = NumberofPersons * costPerPerson (Note if NumberofPersons>40) Not sure about the correctness of equations 3. The attempt at a solution I dont know how to solve it because data is incomplete. ThirtySixCost=? FortyCost=? Somebody please guide me how to solve it. Zulfi. 2. Jul 10, 2017 ### scottdave Reread the problem statement. Your costPerPerson represents the cost per person, when there are 40 people. Your ThirtySixCost is the total cost to rent the plane (but that is a Fixed cost). I did not see anything about greater than 40. You can get to 3 equations and 3 unknowns to solve it. For example (not real numbers), if it costs$360 to rent something (say a lake house), then for 40 people, that is $9 per person, but for 36 people it is$10 per person. It costs $1 more per person if you only have 36 people. Last edited: Jul 10, 2017 3. Jul 11, 2017 ### zak100 Hi, Please tell me how to find costPerPerson? Zulfi. 4. Jul 11, 2017 ### Mark44 ### Staff: Mentor These variable names aren't useful. The fixed cost is the same whether there are 40 people or 36 people. Let x = the cost per person with 40 passengers. Let f = the fixed cost of chartering the airplane. • Write an expression that represents the cost per person with 36 passengers. (Use the information given in the problem.) • Translate the 2nd sentence in the problem statement into an algebraic equation. 5. Jul 11, 2017 ### zak100 Hi, FTC = Fixed Total Cost CPP = Cost Per Person CPP = FTC + 12 I can form only one equation. Please guide me. Zulfi. 6. Jul 11, 2017 ### scottdave The plane costs an amount (call it FTC), whether there is 1 passenger or 36 passenger or 40 passengers. The cost per person depends on the fixed cost (which does not change, and the number of passengers. How about this?: FTC is total fixed cost. CPPForty = FTC / 40. CPPthirtysix = FTC / 36. The problem statement gives you another relationship between CPPForty and CPPthirtysix, which you can make another equation. You may want to re-look at the example problem I posed in post #2, to see how you can relate your problem to that one. 7. Jul 11, 2017 ### Mark44 ### Staff: Mentor The last equation makes no sense. You are saying that the cost for one person is$12 more than the fixed cost.

8. Jul 11, 2017

### zak100

Hi,
Mr. scottdave:
Do you mean this:

CPPThirtySix = CPPForty + 12

Zulfi.

9. Jul 11, 2017

### scottdave

Yes, now with 3 equations you should be able to solve for CPPThirtySix, CPPForty and FTC.

10. Jul 12, 2017

### zak100

Hi,
I am able to solve it.
CP36 = FTC/36 ---(1)
CP40 = FTC/40 ---(2)
CP36 = CP40 + 12--- (3)
After solving these eq., i am able to get correct answer:
CP40 = 108
CP36 = 120 (Not required in the question)
FTC = 4320


# Homework Help: Table probability question

1. Jan 29, 2014

### joshmccraney

1. The problem statement, all variables and given/known data
11 people sit at two round tables, one sits 5 and the other sits 6. how many combinations of seating arrangements are there?

2. Relevant equations
i'm not sure about equations, but my solution attempt may have some info.

3. The attempt at a solution
i know if 11 people were to sit at 1 table, we would have $\frac{11!}{11}=10!$ combinations. thus, would we first have to choose who sits at which table? i.e: $$(11C5)(4!)+(11C6)(6!)$$

thanks for your time (and help!)

2. Jan 29, 2014

### haruspex

You're close, but a couple of errors.
You got 11C54! for choosing the 5 to sit at one table and arranging them. For each such arrangement, how can you arrange the remaining 6?

3. Jan 30, 2014

### joshmccraney

wait, do you mean $(11C5)(4!)+(11C6)(5!)$? also, if we've already selected the 5 to be at on table, do we really need to select 6 for the other?

thanks for the response, and let me know what you think.

4. Jan 30, 2014

### joshmccraney

because i definitely should have done $5!$, not $6!$ (brain fart)

5. Jan 30, 2014

### D H

Staff Emeritus
There are two big problems with your result. One is that when you've chosen the five people who will sit at table #1 you have but one choice as to which set of six people will sit at table #2. The other: Why are you adding?

6. Jan 30, 2014

### joshmccraney

yea, i definitely see this problem but if i dont put both "choices" how do i determine which number (5 or 6) to use?

also, i was adding because i figured after i choose who sits at what table, all i need to do is take the possible combos of one table and add them to the combos of another table.

evidently this is wrong; can you direct me as to what to do next?

7. Jan 30, 2014

### D H

Staff Emeritus
There are a number of right ways to address this part of the problem. You chose a wrong way.

One way to look at this part of the problem is that you choose five people to sit at one table, call it table A. There are 11 choose 5 ways to do this. For any give choice, there are 11-5=6 people left. You now need to choose six of these six people to sit at table B. There are 6 choose 6 ways to do this, and that of course is one. The number of ways to choose people to sit at the two tables is the product of these two numbers: (11 choose 5)*(6 choose 6).

You could of course look at it the other way around: You'll choose six people to sit at the larger table and then choose five of the remaining five to sit at the smaller table. This leads to (11 choose 6)*(5 choose 5) ways to split the people into two groups.

Hmmm. One approach yields (11 choose 5)*(6 choose 6), the other (11 choose 6)*(5 choose 5). Is there a problem here? The answer is no. 11 choose 5 and 11 choose 6 are the same number (462), as are 6 choose 6 and 5 choose 5 (which are of course both 1).

Suppose X and Y are independent. Also suppose there are three ways to accomplish X and five ways to accomplish Y. The number of ways to do accomplish X and Y is fifteen, not eight.

The same applies to the problem at hand. You should be multiplying here, not adding.

8. Jan 30, 2014

### CAF123

You can do it either way (i.e choose 6 for one table and have one set of five for the other, or choose 5 for a table and have one set of six for the other). The result is the same.

Consider the case when there are two people situated at one table and one at the other. How many possible combinations are there?

Alternatively, are the combinations around each individual table dependent on each other? What does this tell you?


# Solving the following equation for x: $(x-5)^{-2} = 9$

1. Jun 24, 2016

### malknar

1. The problem statement, all variables and given/known data
An exercise in Lang's Basic Mathematics which asked to solve for x in the equation $(x - 5)^{-2} = 9$

I tried to solve it and got $x = \frac {16} 3$

which is correct according to the book, but I've found that the book states that x also equals \frac {14}3, and I can't figure out how.
2. Relevant equations

3. The attempt at a solution
$(x-5)^{-2} = 9$

This yields: $x-5 = 9^{-1/2} =\frac 1 {9^{1/2}} = \frac13$

Which yields: $x=\frac 13 +5 = \frac {1+15} 3 =\frac {16}3$

But I can't figure out how can x equals $\frac {14}3$ too.

2. Jun 24, 2016

### Staff: Mentor

It's better to write this as $(x - 5)^2 = \frac 1 9$, which leads to $x - 5 = \pm \sqrt{\frac 1 9}$
Quadratic equations can have two solutions.

3. Jun 24, 2016

### mfig

What is $(-\frac{1}{3})^2$?

4. Jun 24, 2016

### late347

I am thinking about that old math movie with young actor Edward James Olmos. He was playing the role of high school teacher.

Stand and deliver

"Negative times negative is positive!!!" The result would be 1/9

For the original poster's benefit. The following is compiled from my own high school era old math factbook.

second degree equations.
• you can evaluate whether the quadratic has two roots, or one root, or none of the real-numbered roots. (roots belonging to ℝ)
• calculate the quadratic into the form of: $$Ax^2 + Bx+C= 0$$
$$x=\frac{-B±\sqrt{B^2-4AC}}{2A}$$

this is called the discriminant part of the equation $D=\sqrt{B^2-4AC}$

if D>0, then the equation has two non-equal roots
if D=0, then the equation has a twin-root
if D<0, then the equation doesn't have real-numbered roots (roots in the real numbers ℝ)
This last fact is because negative inside the squareroot sign is not defined.
E.g. $\sqrt{(-5)}= ~~not ~~defined~~ in~~ real~~ numbers$

negative inside the squareroot is defined in the complex numbers, I think, but I have no knowledge of the complex numbers myself. (complex numbers symbol is this one ℂ)

5. Jun 24, 2016

### epenguin

In short if A2 = B, then A = ± √B

6. Jun 24, 2016

### malknar

I got it now, thanks everyone. As usual the solution is simpler than expected. My mistake was not considering $-3 = 9^{1/2}$

7. Jun 24, 2016

### Staff: Mentor

The symbol $\sqrt{x}$ denotes the positive square root of x, by established convention. In this case $\sqrt{9} = +3$. However, the equation $x^2 = 9$ has two solutions: 3 and -3.

8. Jun 24, 2016

### Ray Vickson

No: $9^{1/2}$ is $+3$, NOT $-3$. Essentially by definition, the functions $x^{1/2}$ and $\sqrt{x}$ mean the positive root.

There is no really good language for it, but saying "a" square root instead of "the" square root comes close to capturing it: there are two roots to the equation $x^2 = a \:(a > 0)$; these are $x = \sqrt{a}$ and $x = -\sqrt{a}$

9. Jun 24, 2016

### late347

• watch this khan academy video it will be helpful for this problem and also for the purpose of increased understanding.
• review what is the binomial square formula such as:
• $(a+b)^2= a^2+2ab+b^2$
• $(a-b)^2 = a^2-2ab+b^2$

10. Jul 6, 2016

### James R

Alternatively you could do this:
$\frac{1}{(x-5)^2}=9$
$9(x-5)^2 = 1$
$9(x^2 - 10 x + 25) = 1$
$9x^2 - 90 x + 224 = 0$
$(3x - 14)(3x - 16)=0$
$x=\frac{14}{3}$ or $x=\frac{16}{3}$.


# Find the differential equations of the following family of curves.

16 posts / 0 new
Bingo
Find the differential equations of the following family of curves.

Differential Equations
Find the differential equations of the following family of curves.

1. Parabolas with axis parallel to the y – axis with distance vertex to focus fixed as a.
2. Parabolas with axis parallel to the x – axis with distance vertex to focus fixed as a.
3. All ellipses with center at the origin and axes on the coordinate axes.
4. Family of cardioids.
5. Family of 3 – leaf roses.

Bingo

1

Jhun Vert

(1) Upwards and downwards parabolas with latus rectum equal to 4a.
$y - k = \pm 4a(x - h)^2$

$y' = \pm 8a(x - h)$

$y'' = \pm 8a$

Bingo

y−k=±4a(x−h)2 is this the equation for parabolas?
isn't it 4a(y-k)=(x-h)2 ?

Jhun Vert

I made a mistake in there, it should be (x - h)2 = ±4a(y - k). The solution for (1) should go this way:
$(x - h)^2 = \pm 4a(y - k)$

$2(x - h) = \pm 4ay'$

$2 = \pm 4ay''$

$y'' = \pm \frac{1}{2a}$

Bingo

y−k=±4a(x−h)2 is this the equation for parabolas?
isn't it 4a(y-k)=(x-h)2 ?

Jhun Vert

Bingo

so for number 2,
x-h=±4a(y-k)2
x'=±8a(y-k)
x''=±8a
am i wrong?

Jhun Vert

It is better to express your answer in terms of y' rather than x'. Although x' will do and simpler.
$(y − k)^2 = \pm 4a(x − h)$

$2(y − k)y' = \pm 4a$

$y' = \dfrac{\pm 2a}{y - k}$

Note: $y - k = \dfrac{y'}{\pm 2a}$

$y'' = \dfrac{\mp 2a \, y'}{(y - k)^2}$

$y'' = \dfrac{\mp 2a \, y'}{\left( \dfrac{y'}{\pm 2a} \right)^2}$

$y'' = \dfrac{\mp 8a}{y'}$

$y'' \, y' = \pm 8a$

ChaCha Ingal Cortez

our prof. gave the same question but the ans. he gave is different from your ans. in no 2, his answer is (y')^3 + 2ay"=0 are they the same with your answer sir ?

Jhun Vert

They are different. I made a mistake in $y - k$ of the above solution.
$(y − k)^2 = \pm 4a(x − h)$

$2(y - k) \, y' = \pm 4a$

$y' = \dfrac{\pm 2a}{y - k}$

$y - k = \dfrac{\pm 2a}{y'}$

$y'' = \dfrac{\mp 2a \, y'}{(y - k)^2}$

$y'' = \dfrac{\mp 2a \, y'}{\left( \dfrac{\pm 2a}{y'} \right)^2}$

$y'' = \dfrac{\mp 2a \, y'}{\dfrac{4a^2}{(y')^2}}$

$y'' = \dfrac{\mp (y')^3}{2a}$

$2a \, y'' = \mp (y')^3$

$\pm (y')^3 + 2a \, y'' = 0$

Bingo

Thank You so much sir.

Bingo

sir, do you know the standard or general equations for the last 3 problems?
what equations should i use?

Shandy

I think you are from ADZU haha

Alegnaaa (guest)

Good evening, sir. Do you have the solution for the last three problems? Thank you!

Ancha (guest)

Sir do you know how to eliminate arbitrary constant here in this equation?
(y-33)²=4a(x-h)?

• Mathematics inside the configured delimiters is rendered by MathJax. The default math delimiters are $$...$$ and $...$ for displayed mathematics, and $...$ and $...$ for in-line mathematics.


# How many four digit integers are there that do not have two consecutive equal even digits?

How many four digit integers are there that do not have two consecutive equal even digits?

My Attempt There are $9*10^3$ four digit numbers. We tie two equal even digits and form the four digit numbers with them. This can be done in $5 \cdot \binom{3}{2} \cdot 10 \cdot 10 = 1500$ ways. There are $10 \cdot 10$ numbers starting with $00$ so we must subtract them from $1500$. So answer is $9000 - 1400 = 7600$. But it is not matching with the given answer $7801$. Can any one help me to find out where I am making mistakes? Thanks in advance.

1. You did not account for the fact that there are only $9$ choices for the leading digit when neither number in the pair of consecutive equal even digits is in the thousands place.
2. You have subtracted numbers in which there are three or more consecutive even digits more than once.

First, we observe that there are $9 \cdot 10 \cdot 10 \cdot 10 = 9000$ four-digit positive integers.

Let $A_1$ be the set of four-digit positive integers in which the thousands place and hundreds place contain equal even digits. Let $A_2$ be the set of four-digit positive integers in which the hundreds place and tens place contain equal even digits. Let $A_3$ be the set of four-digit positive integers in which the tens place and units place contain equal even digits. Then $A_1 \cup A_2 \cup A_3$ is the set of four-digit positive integers that do contain consecutive equal even digits. By the Inclusion-Exclusion Principle, the number of four-digit positive integers that do contain consecutive even digits is $$|A_1 \cup A_2 \cup A_3| = |A_1| + |A_2| + |A_3| - |A_1 \cap A_2| - |A \cap A_3| - |A_2 \cap A_3| + |A_1 \cap A_2 \cap A_3|$$

$|A_1|$: Since we cannot use zero, there are four ways of choosing the even digit that occupies both the thousands and hundreds place. There are ten choices for each of the remaining digits. Hence, $|A_1| = 4 \cdot 10 \cdot 10 = 400$.

$|A_2|$: Since we cannot use zero, the thousands place can be filled in nine ways. There are five ways to choose the even digit that fills both the hundreds and tens places. There are ten ways to fill the units place. Hence, $|A_2| = 9 \cdot 5 \cdot 10 = 450$.

$|A_3|$: We can fill the thousands place in nine ways and the hundreds place in ten ways. There are five ways to choose the even digit that occupies both the tens and units places. Hence, $|A_3| = 9 \cdot 10 \cdot 5 = 450$.

$|A_1 \cap A_2|$: Since we cannot use zero, there are four ways to choose the even digit that occupies the thousands, hundreds, and tens places. There are ten ways to fill the units place. Hence, $|A_1 \cap A_2| = 4 \cdot 10 = 40$.

$|A_1 \cap A_3|$: There are four ways to choose the even digit that occupies both the thousands and hundreds places and five ways to choose the even digit that occupies both the tens and units places. Hence, $|A_1 \cap A_3| = 4 \cdot 5 = 20$.

$|A_2 \cap A_3|$: There are nine ways to fill the thousands place. There are five ways to choose the even digit that occupies the hundreds, tens, and units places. Hence, $|A_2 \cap A_3| = 9 \cdot 5 = 45$.

$|A_1 \cap A_2 \cap A_3|$: Since we cannot use zero, there are four ways to choose the even digit that occupies the thousands, hundreds, tens, and units places. Hence, $|A_1 \cap A_2 \cap A_3| = 4$.

Therefore, the number of four-digit positive integers that do contain consecutive even equal digits is \begin{align*} |A_1 \cup A_2 \cup A_3| & = |A_1| + |A_2| + |A_3| - |A_1 \cap A_2| - |A \cap A_3| - |A_2 \cap A_3| + |A_1 \cap A_2 \cap A_3|\\ & = 400 + 450 + 450 - 40 - 20 - 45 + 4\\ & = 1199 \end{align*} Therefore, the number of four-digit positive even integers that do not contain consecutive equal even digits is $9000 - 1199 = 7801$.

• Thanks for pointing the errors and nice step by step solution. – rugi Jul 31 '17 at 9:05

This where you're making a mistake $-$

What you're trying to do is called the inclusion-exclusion principle. Your error is in the fact that you are overcounting numbers such as $4446$. If I understand your method correctly, you are blacklisting this number twice instead of once.

IMO, an easier way to solve the problem is to count the numbers that are not to be included first by going through all possible digit combinations e.g. $aabb$ etc.


# If $\lim_{x \rightarrow 0}\frac{f(x)}{x^2} = 5$, then what is $\lim_{x \rightarrow 0}f(x)$?

I know the answer to the above question, but I have a question on some of the reasoning.

The way I know how to solve it is $$\lim_{x \rightarrow 0}f(x) = \lim_{x \rightarrow 0}\left(f(x)\cdot \frac{x^2}{x^2}\right) = \lim_{x \rightarrow 0}\left(\frac{f(x)}{x^2}\cdot x^2\right) = \left(\lim_{x \rightarrow 0}\frac{f(x)}{x^2}\right)\left(\lim_{x \rightarrow 0}x^2\right) = 5\cdot0 = 0.$$

I saw another solution elsewhere that gets the right answer, but I am unsure if the steps are actually correct. \begin{align*} &\lim_{x \rightarrow 0}\frac{f(x)}{x^2} = 5 \\ \Longrightarrow &\frac{\lim_{x \rightarrow 0}f(x)}{\lim_{x \rightarrow 0}x^2} = 5 \\ \Longrightarrow &\lim_{x \rightarrow 0}f(x) = 5\cdot \lim_{x \rightarrow 0}x^2\\ \Longrightarrow &\lim_{x \rightarrow 0}f(x) = 5\cdot 0 = 0. \end{align*}

My issue is with that first step. I know that $$\lim_{x \rightarrow a} \frac{f(x)}{g(x)} = \frac{\lim_{x \rightarrow a}f(x)}{\lim_{x \rightarrow a}g(x)}$$, but only when $$\lim_{x \rightarrow a}g(x) \neq 0$$. Since $$\lim_{x \rightarrow 0}x^2 = 0$$, wouldn't this invalidate the above work? However, it still got the same answer, so my real question is why did it work and when will it work in general?

EDIT: Does anyone have a nice example for when the logic in the second method doesn't work?

• You are correct that the solution you saw elsewhere is invalid. It is invalid for the exact reason you think it is. Using false logic to get a correct answer is still false logic. Applied to another problem, it might fail. – InterstellarProbe May 8 at 16:38
• Do you have an example of another problem in which logic from the second method fails? – Smash May 8 at 16:45
• Simply put, you can't divide by zero. If you want examples, there are many "proofs" of $0=1$ where the trick is to divide by zero and hope no one notices. – Théophile May 8 at 16:47

If $$\lim\limits_{x\to0}\dfrac{f(x)}{x^2}=5$$, then for every $$n\in\Bbb N$$ there is some $$x\neq 0$$ such that $$5-\frac1n<\frac{f(x)}{x^2}<5+\frac1n$$ and hence $$5x^2-\frac{x^2}n If $$x\to 0$$ we get $$f(x)\to 0$$.

$$\frac{\lim_{x \rightarrow 0}f(x)}{\lim_{x \rightarrow 0}x^2} = 5$$ doesn't work, the LHS is not defined.

But for the limit of $$\dfrac{f(x)}{x^2}$$ to exist, $$\lim_{x\to0}f(x)$$ must be zero, which is also the limit of $$x^2$$.

You can not do this since the denominator on the right is $$0$$.

$$\lim_{x \rightarrow 0}\frac{f(x)}{x^2} = \frac{\lim_{x \rightarrow 0}f(x)}{\lim_{x \rightarrow 0}x^2}$$

But first aproach is perfect.

• You meant "denominator," not numerator. – Mark Viola May 8 at 16:41


# Probability of winning dice game

#### TheFallen018

##### Member
Hey, so I've got this problem that I'm trying to figure out. I've worked out something that I think is probably right through simulation, but I'm not really sure how to tackle it from a purely mathematical probability perspective. So, would anyone know how I should approach this? I've tried a few different things, but my two answers tend to conflict a little. Thanks,

#### Opalg

##### MHB Oldtimer
Staff member
The starting point (which I guess you already know) is to make a list of the probabilities $p(x)$ of rolling a total of $x$ with the two dice, where $x$ goes from $2$ to $12$. These are $$\begin{array}{r|ccccccccccc}x& 2&3&4&5&6 &7&8&9&10 &11&12\\ \hline p(x) & \frac1{36} & \frac2{36} & \frac3{36} & \frac4{36} & \frac5{36} & \frac6{36} & \frac5{36} & \frac4{36} & \frac3{36} & \frac2{36} & \frac1{36} \end{array}.$$

The probability of an immediate win on the first roll is $p(7)+p(11)$. To win at a later stage, you first need to roll an $x$ (where $x$ is $4,5,6,8,9$ or $10$). You then need to roll another $x$ before rolling a $7$. The probability of those two things happening is $p(x)\dfrac{p(x)}{p(x)+p(7)}$. Putting in the numbers, and adding the various probabilities, I get the overall probability of a win to be $\dfrac{244}{495} \approx 0.49292929\ldots$.

#### TheFallen018

##### Member
The starting point (which I guess you already know) is to make a list of the probabilities $p(x)$ of rolling a total of $x$ with the two dice, where $x$ goes from $2$ to $12$. These are $$\begin{array}{r|ccccccccccc}x& 2&3&4&5&6 &7&8&9&10 &11&12\\ \hline p(x) & \frac1{36} & \frac2{36} & \frac3{36} & \frac4{36} & \frac5{36} & \frac6{36} & \frac5{36} & \frac4{36} & \frac3{36} & \frac2{36} & \frac1{36} \end{array}.$$

The probability of an immediate win on the first roll is $p(7)+p(11)$. To win at a later stage, you first need to roll an $x$ (where $x$ is $4,5,6,8,9$ or $10$). You then need to roll another $x$ before rolling a $7$. The probability of those two things happening is $p(x)\dfrac{p(x)}{p(x)+p(7)}$. Putting in the numbers, and adding the various probabilities, I get the overall probability of a win to be $\dfrac{244}{495} \approx 0.49292929\ldots$.
Wow, that works really well. I thought it was going to be much more complicated and messy than that, which is a beautiful solution. I'm curious though, is that equation $p(x)\dfrac{p(x)}{p(x)+p(7)}$ something that you derived for this, or is this a standard formula for similar problems.If it's something that you derived, would you be able to explain how you came up with it? If it's a standard equation, would you happen to know it's name? I'd love to understand better how and why it works. Thanks

#### Opalg

##### MHB Oldtimer
Staff member
Wow, that works really well. I thought it was going to be much more complicated and messy than that, which is a beautiful solution. I'm curious though, is that equation $p(x)\dfrac{p(x)}{p(x)+p(7)}$ something that you derived for this, or is this a standard formula for similar problems.If it's something that you derived, would you be able to explain how you came up with it? If it's a standard equation, would you happen to know it's name? I'd love to understand better how and why it works. Thanks
In the expression ${\color {red} p(x)}{\color {green}\dfrac{p(x)}{p(x)+p(7)}}$, the red $\color {red} p(x)$ gives the probability that the first roll of the dice gives the value $x$. The green fraction represents the probability of rolling $x$ again before rolling a $7$. My argument for that is that after rolling the first $x$, you can completely disregard any subsequent rolls until either an $x$ or a $7$ turns up. The only question is, which one of those will appear first. The relative probabilities of $x$ and $7$ are in the proportion $p(x)$ to $p(7)$. So out of a combined probability of $p(x) + p(7)$, the probability of an $x$ is $\dfrac{p(x)}{p(x)+p(7)}$, and the probability of a $7$ is $\dfrac{p(7)}{p(x)+p(7)}$.

I hope that makes sense.


I'm Confused's question on Yahoo! Answers involving a recurrence relation

MarkFL

Staff member
Jonah must take an antibiotic every 12 hours. Each pill is 25 milligrams, and after every 12 hours, 50% of the drug remains in his body. What is the amount of antibiotic in his body over the first two days? What amount will there be in his body in the long run?

Here's what I did:

For my recursive formula, I tried inputting u(n)=u(n-1)*(1-0.50). However, I could not seem to find the long run value.,,, It keeps changing. Am I right on this?

I appreciate your help! Thank you so much!

Source: <Advanced Algebra: An Investigative Approach; Murdock Jerald, 2004>
I posted a link to this topic, so the OP could find my response.

Here is a link to the original question:

Recursive formula help on real world situations? - Yahoo! Answers

Let $A(t)$ represent the amount, in mg, of antibiotic in Jonah's bloodstream at time $t$, measured in hours. With a half-life of 12 hours, we may state:

$\displaystyle A(t)=A_02^{-\frac{t}{12}}$

So, for the first 12 hours, but not including the second dose, we find:

$\displaystyle A_0=25$ hence:

$\displaystyle A(t)=25\cdot2^{-\frac{t}{12}}$

$\displaystyle A(t)=25\cdot2^{-\frac{12}{12}}=\frac{25}{2}$

Now, for the second 12 hours, we have:

$\displaystyle A_0=\frac{25}{2}+25=\frac{75}{2}$ hence:

$\displaystyle A(t)=\frac{75}{2}\cdot2^{-\frac{t}{12}}$

$\displaystyle A(12)=\frac{75}{2}\cdot2^{-\frac{12}{12}}=\frac{75}{4}$

For the third 12 hours, we have:

$\displaystyle A_0=\frac{75}{4}+25=\frac{175}{4}$ hence:

$\displaystyle A(t)=\frac{175}{4}\cdot2^{-\frac{t}{12}}$

$\displaystyle A(12)=\frac{175}{4}\cdot2^{-\frac{12}{12}}=\frac{175}{8}$

For the fourth 12 hours, we have:

$\displaystyle A_0=\frac{175}{8}+25=\frac{375}{8}$ hence:

$\displaystyle A(t)=\frac{375}{8}\cdot2^{-\frac{t}{12}}$

$\displaystyle A(12)=\frac{375}{8}\cdot2^{-\frac{12}{12}}=\frac{375}{16}$

So, now we may try to generalize for the $n$th 12 hour period.

Let $I_n$ represent the initial amount for each 12 hour period. We see we must have the recursion:

$I_{n+1}=\frac{1}{2}I_{n}+25$

This is an inhomogeneous recurrence, so let's employ symbolic differencing to obtain a homogeneous recurrence:

$I_{n+2}=\frac{1}{2}I_{n+1}+25$

Subtracting the former from the latter, we obtain:

$2I_{n+2}=3I_{n+1}-I_{n}$

The characteristic equation is:

$2r^2-3r+1=0$

$(2r-1)(r-1)=0$

Hence, the closed-form will be:

$I_n=k_1\left(\frac{1}{2} \right)^n+k_2$

We may use our data above to determine the parameters $k_i$:

$I_1=k_1\left(\frac{1}{2} \right)^1+k_2=25$

$I_2=k_1\left(\frac{1}{2} \right)^2+k_2=\frac{75}{2}$

or

$\frac{1}{2}\cdot k_1+k_2=25$

$\frac{1}{4}\cdot k_1+k_2=\frac{75}{2}$

Solving this system, we find:

$k_1=-50,k_2=50$ and so we have:

$I_n=-50\left(\frac{1}{2} \right)^n+50=50\left(1+\left(\frac{1}{2} \right)^n \right)$

And so, for the $n$th 12 hour period, we have:

$\displaystyle A_n(t)=I_n2^{-\frac{t}{12}}$

Now, for the long run, which we may take as implying as n grows without bound, we find:

$\displaystyle \lim_{n\to\infty}I_n=50$

and so we find that for the long run the initial amount for a 12 hour period is is 50 mg and the final amount for that period is 25 mg.

Last edited:

tkhunny

Well-known member
MHB Math Helper
That is good mathematics, but not so great reality. If it had said I.V. Administration, the assumption of immediate absorption and distribution would be more realistic. Even subcutaneous or intramuscular injection takes a little while. A pill? No.


# Polynomial Sprint: Useful Lemma

$\color{#D61F06} {\text{Unlocked!}}$

Mathematicians have a huge bag of tricks, which provide them with various ways of approaching a problem. In this note, we introduce an extremely useful lemma, which applies to polynomials with integer coefficients.

Lemma. If $f(x)$ is a polynomial with integer coefficients, then for any integers $a$ and $b$, we have $a-b \mid f(a) - f(b)$

1) Show that for any integers $a, b$ and $n$, we have

$a-b | a^n - b^n.$

2) Using the above, prove the lemma.

3) Come up with a (essentially) two-line solution to question 4 from the book.

Note: In Help Wanted, Krishna Ar mentioned that problem 4 from the book was hard to solve. If you looked at the solution, it was also hard to understand what exactly was happening. This provides us with a simple way of comprehending why there are no solutions.

4) Come up with an alternative solution to E6 (page 250, from the book) using this lemma.

5) * (Reid Barton) Suppose that $f(x)$ is a polynomial with integer coefficients. Let $n$ be an odd positive integer. Let $x_1, x_2, \ldots x_n$ be a sequence of integers such that

$x_2 = f(x_1), x_3 =f(x_2), \ldots x_n = f(x_{n-1}), x_1 = f(x_n) .$

Show that all the $x_i$ are equal.
Where did you use the fact that $n$ is an odd positive integer?

Note by Calvin Lin
5 years, 9 months ago

This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.

When posting on Brilliant:

• Use the emojis to react to an explanation, whether you're congratulating a job well done , or just really confused .
• Ask specific questions about the challenge or the steps in somebody's explanation. Well-posed questions can add a lot to the discussion, but posting "I don't understand!" doesn't help anyone.
• Try to contribute something new to the discussion, whether it is an extension, generalization or other idea related to the challenge.

MarkdownAppears as
*italics* or _italics_ italics
**bold** or __bold__ bold
- bulleted- list
• bulleted
• list
1. numbered2. list
1. numbered
2. list
Note: you must add a full line of space before and after lists for them to show up correctly
paragraph 1paragraph 2

paragraph 1

paragraph 2

[example link](https://brilliant.org)example link
> This is a quote
This is a quote
    # I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
# I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
MathAppears as
Remember to wrap math in $$ ... $$ or $ ... $ to ensure proper formatting.
2 \times 3 $2 \times 3$
2^{34} $2^{34}$
a_{i-1} $a_{i-1}$
\frac{2}{3} $\frac{2}{3}$
\sqrt{2} $\sqrt{2}$
\sum_{i=1}^3 $\sum_{i=1}^3$
\sin \theta $\sin \theta$
\boxed{123} $\boxed{123}$

Sort by:

I really like Polynomial Sprint. It would be nice if you can do some other themes using similar form.

- 5 years, 8 months ago

Yes, I entirely agree! I find these sets fun to do and I want more sets.

- 5 years, 8 months ago

This has been unlocked. Sorry for being late, I was out yesterday.

Staff - 5 years, 9 months ago

What does the $|$ mean?

- 5 years, 9 months ago

$a|b$ means $a$ divides $b$

- 5 years, 9 months ago

1) $a-b|a^n-b^n$, let $f(x)=x^n$, and plug in $a$ and $b$ into the function and we get $a-b|a^n-b^n$, is this correct?

- 5 years, 9 months ago

You have to show that it is true of all polynomials, not just specially chosen polynomials.

Staff - 5 years, 9 months ago

The lemma is true for polynomials with integer coefficients, so do you mean that I must show that this is true for non-integers too?

- 5 years, 9 months ago

I might have initially misinterpreted what you are trying to do.

The statement in question 1 is about integers (not polynomials), and you are asked to show that for any pair of integers, we have $a - b \mid a^n - b^n$. For example, $10 - 7 \mid 10^3 - 7^3$, or equivalently that $3 \mid 657$.

Note that you are not allowed to use the lemma, since we want to use question 1 to prove the lemma (in question 2).

Staff - 5 years, 9 months ago

Oh, ok

- 5 years, 9 months ago

5) We see that $x_n-x_{n+1}\mid f(x_n)-f(x_{n+1})=x_{n+1}-x_{n+2}$.

Thus we get the following divisibilitites:

$x_1-x_2\mid x_2-x_3\implies x_2-x_3=k_1(x_1-x_2)$

$x_2-x_3\mid x_3-x_4\implies x_3-x_4=k_2(x_2-x_3)$

$\vdots$

$x_{n-1}-x_n\mid x_n-x_1\implies x_n-x_1=k_{n-1}(x_{n-1}-x_n)$

$x_n-x_1\mid x_1-x_2\implies x_1-x_2=k_n(x_n-x_1)$

This means that $x_1-x_2=k_1k_2\cdots k_n(x_1-x_2)$

since $x_1\ne x_2$, we can divide both sides by $x_1-x_2$ to get $k_1k_2\cdots k_n=1$

Since we are working in the integers, this means that $|k_i|=1$ for all $i=1\to n$.

Thus, $x_k-x_{k+1}=\pm (x_{k-1}-x_k)$

What I got so far.

- 5 years, 9 months ago

If some $k_i=-1$, then we have $x_k=x_{k+1}$, which leads to equality of all $x_i$. If all k=1, then we can sum and get $x_1-x_2=0$, so $x_1=x_2$, which contradicts to your assumption that $x_1$ is different from $x_2$. Then that again leads to $x_1=x_2=...=x_n$

- 5 years, 9 months ago

Is it that simple? When did you use the condition that $n$ is odd?

- 5 years, 9 months ago

You just consider it modulo |x2 - x1| :

Let d equal |x1 – x2| and thus d = |x1 – x2| = |x2 – x3| = |x3 – x4| = … = |x{n-1} – x{n}| = |x{n} – x1|. If d is nonzero then x2 is congruent to (x1 + d) mod 2d. Similarly x3 is congruent to (x2 + d) mod 2d which is congruent to x1 mod 2d. In general x{k} is congruent to (x1 + d) mod 2d if k is even and congruent to x1 mod 2d if k is odd. Thus we have x{n} is congruent to x1 mod 2d because n is odd. However then |x{n} – x1| = 2dq for an integer q. Also d = |x{n} – x1|, hence d = 2dq and 1 = 2q. This contradicts the fact that q is an integer, hence our previous assumption that d is nonzero must be false. Therefore d = |x1 – x2| = |x2 – x3| = |x3 – x4| = … = |x{n-1} – x{n}| = |x{n} – x1| = 0 and x1 = x2 = x3 = …=x{n} and all the x{i} are equal.

- 5 years, 8 months ago

I do not immediately see how we get $k_k = 0 \Rightarrow x_k = x_{k+1}$ in the first scenario. I think we get $x_{k} = x_{k+2}$ instead, but that isn't immediately useful.

@Daniel Liu You are nearly there. Let me phrase the rest of the question in a different way. You start at some point $X$ on the real number line. You take $n$ odd steps of size exactly $S$. If you end back at $X$, show that $S = 0$.

Staff - 5 years, 9 months ago

We want another polynomial sprint! Soon..

- 5 years, 8 months ago

I guess We can write any polynomial a^n+b^n as (a-b)(a^n-1+a^n-2 b^1. .... Till b^n-1) therefore its always divisible by a-b

- 5 years, 9 months ago

Where can I get the book?

- 5 years, 9 months ago

- 5 years, 9 months ago

- 5 years, 9 months ago

1)a^n-b^n=(a-b)(a^(n-1)+a^(n-2) b+...+b^(n-1)) Which leads us to:a-b/a^n-b^n 2) let f be a polynomial f (x)=an.x^n+an-1.x^(n-1)+...+a0 We can apply question1 since it is true for any n For j {0, n}: a-b / a^j-b^j We can sum Leads us to:a-b/f (a)-f (b) 5) x1-x2 =k1 (xn-x1) x2-x3=k2 (x1-x2) . . . xn-1-xn=kn (xn-2 -xn-1) Leads us to ki=1 or =-1 If one ki=-1 We have xi are equals If all ki=1 (x1-x2)+(x2-x3)+...+(xn-1 -xn)=(xn-x1)+ (x1-x2)+...+(xn-2 - xn-1) Leads us to: x1-xn = xn- xn-1 If just xi#xi-1 We have contradiction: (xi-xi-1)=0=(xi-1 -xi-2)#0 We can make recurrence(recurrance in french) We leads to an a contradiction each time Then k#1 Then all xi are equals

- 5 years, 9 months ago

1. Let $f(t)=t^n-b^n$. Then $f(b)=b^n-b^n=0$, so $t-b\mid t^n-b^n$. Let $t=a$ to get $a-b\mid a^n-b^n$.
2. Consider the $k$th coefficient of $f(a)-f(b)$: $a_k(a^k-b^k)$. Since $a-b\mid a^k-b^k$, $a-b$ is a factor of every term in $f(a)-f(b)\implies a-b\mid f(a)-f(b)$.
For the rest, I don't know which book you're talking about.

- 5 years, 9 months ago

Problem Solving Strategies by Arthur Engel. They might be selling online I don't really know. XD

- 5 years, 9 months ago

Google "arthur engel problem solving strategies", and follow the first link, which should be a pdf. The url is below but you have to surround the italicized text with underscores:

- 5 years, 8 months ago

- 5 years, 8 months ago

Oh oops, never mind the url.

- 5 years, 8 months ago

Book? What book?

- 5 years, 9 months ago

Google "arthur engel problem solving strategies", and follow the first link, which should be a pdf. The url is below but you have to surround the italicized text with underscores: http://f3.tiera.ru/2/MMathematics/MSchSchool-level/Engel%20A.%20Problem-solving%20strategies%20(for%20math%20olympiads)(Springer,%201998)(ISBN%200387982191)(O)(415s)MSch.pdf

- 5 years, 8 months ago

Oh oops, never mind the url.

- 5 years, 8 months ago

Thanks.. will do that. :)

- 5 years, 8 months ago

You may refer to the original post Let's Get Started to understand the context of the Polynomial Sprint set.

Staff - 5 years, 9 months ago