# Sum of Harmonic Series

It is well known that the sum of a harmonic series does not have a closed form. Here is a formula which gives us a good approximation.

We need to find the sum of the following series

$\dfrac{1}{a}+\dfrac{1}{a+d}+\dfrac{1}{a+2d}+\ldots+\dfrac{1}{a+(n-1)d}$

Consider the function $$f(x)=\frac{1}{x}$$, we intend to take middle riemann sums with rectangles of width $$d$$ starting from $$x=a$$ to $$x=a+(n-1)d$$.

Each rectangle in the figure has a width $$d$$. The height of the $$i\text{th}$$ rectangle is $$\frac{1}{a+(i-1)d}$$. The sum of the area of the rectangles is approximately equal to the area under the curve.

Area under f(x) from $$x=a-\frac{d}{2}$$ to $$x=a+\left(n-\frac{1}{2}\right)d \approx\displaystyle\sum_{n=1}^{n} \frac{d}{a+(n-1)d}$$

$\large\Rightarrow \int_{a-\frac{d}{2}}^{a+\left(n-\frac{1}{2}\right)d} \dfrac{\mathrm{d}x}{x}\approx \displaystyle\sum_{n=1}^{n} \frac{d}{a+(n-1)d}$

Let $$S_n =\displaystyle\sum_{n=1}^{n} \frac{1}{a+(n-1)d}$$

$\large\ln\dfrac{2a+(2n-1)d}{2a-d}\approx d\times S_n$

$\large\boxed{\Rightarrow s_n\approx\dfrac{\ln\dfrac{2a+(2n-1)d}{2a-d}}{d}}$

Note

• Apologies for the shabby graph.

• $$d\neq 0$$

Note by Aneesh Kundu
2 years, 6 months ago

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:

@Aneesh Kundu I have just added your formula to Harmonic Progression wiki. I have also added important points from your discussion with Atul. You can also contribute to the wiki.

- 2 years, 1 month ago

How can area under that curve=d×Sn ??here d is denoted as width

- 2 years, 2 months ago

Area under the curve $A=\frac{1}{a} d +\frac{1}{a+d} d+ \frac{1}{a+2d} d \ldots$ $\frac{A}{d}= ( \frac{1}{a}+ \frac{1}{a+d} \ldots )$ $A=d\dot S_{n}$

- 2 years, 2 months ago

Ohoo now i understand clearly. Thanks bro...

- 2 years, 2 months ago

your above expression will be incorrect when $\boxed{2a=d}$

- 2 years, 5 months ago

In this case calculate the sum from $$a_2$$ to $$a_n$$, using the given formula and then add $$a_1$$ to both sides.

- 2 years, 5 months ago

Hey how you have assigned limit of $$x$$ can you please clarify

- 2 years, 6 months ago

$$x$$ varies from $$a-\frac{d}{2}$$ to $$a+\left(n-\frac{1}{2}\right)d$$.

- 2 years, 5 months ago

yaa ,I got this but also you can't use this formula for finding sum of similar terms

i.e. $$S_n= \frac {1}{2}+ \frac {1}{2}+ \frac {1}{2}+ \frac {1}{2}+.... \frac {1}{2}(n^{th} term)$$ as common difference is $$0$$ so it will be in indeterminate form

- 2 years, 5 months ago

Thanks for the suggestion, I added this point in the note.

- 2 years, 5 months ago

I mean to is it original(your own)???

- 2 years, 5 months ago

Nope, its not purely original. I was reading about the convergence tests and I happened came across the Integral test, which inspired this note.

- 2 years, 5 months ago

it's really fantastic

- 2 years, 5 months ago

Thanks. :)

- 2 years, 5 months ago

by the way is it real???

- 2 years, 5 months ago

This formula gives really good approximations when $$d\rightarrow 0$$ or for large values of $$n$$ with a not so big $$d$$ .

- 2 years, 5 months ago

Just followed you :-)

- 2 years, 5 months ago

Yes Absolutely

- 2 years, 5 months ago

Thanks! This is a very good and useful note.

- 2 years, 6 months ago

Thanks. :)

- 2 years, 5 months ago


# Are there many different power series representation for a given function?

So I have to find the power series representation for $f(x) = \ln (3-x)$.

I attempted the following:

$$\ln(3-x) = \int {- \frac{1}{3-x} dx}$$ $$= - \int { \frac{1}{1-(x-2)} dx}$$ $$= - \int {\sum_{n=0}^{\infty}{(x-2)^n} dx}$$ $$= \sum_{n=0}^{\infty} {\int(x-2)^ndx}$$ $$= \bigg(-\sum_{n=0}^{\infty} \frac{(x-2)^{n+1}}{n+1}\bigg)+K$$

Then if we let $x=2$, then we obtain that $K=0$. Hence the power series representation for $f(x)$ is $-\sum_{n=0}^{\infty} \frac{(x-2)^{n+1}}{n+1}$, where $|x-2|<1$.

However the answer from my lecturer is given as: $$\ln(3)-\sum_{n=1}^{\infty}{\frac{x^n}{n\cdot3^n}}$$

Am I doing a mistake? Or are there many different power series representation for a given function? Any clarification would be highly appreciated.

• It depends where you want to center your power series. Setting a given center, the power series representation is unique (and it exists for an holomorphic function). – Paolo Leonetti Aug 15 '15 at 12:24
• @PaoloLeonetti thanks for your explanation! that makes perfect sense. however, the question does not really specify the center of the power series representation. does that mean that my answer is actually correct as well? – Aaron Aug 15 '15 at 12:36
• In a word, yes :) Ps. How do you justify the exachange of infinite summation and integral? – Paolo Leonetti Aug 15 '15 at 12:36
• @PaoloLeonetti is that because we are allowed to do term-by-term integration? – Aaron Aug 15 '15 at 12:41
• " the question does not really specify the center of the power series representation. does that mean that my answer is actually correct as well?" In a word, no because when the center is not specified one is supposed to understand the center is zero. (Additionnally, in some curricula the only admissible center is zero.) – Did Aug 16 '15 at 15:59

Hint. Your route is OK, but you should rather start with $$\ln(3-x) = -\int_0^x { \frac{1}{3-t} dt}+\ln 3$$ then follow the same path to obtain the right answer.

• Thanks! I followed this and ended up in the same form. however, say in an exam i wrote like the above, would it be correct though? – Aaron Aug 15 '15 at 12:36

Both series are correct. The one from the lecture is the series expansion around $x=0$, while the one derived in the posted question is the series expansion around $x=2$. And one could choose other arbitrary points around which to expand the function.

Using a straightforward approach we see that for $f(x)=\log(3-x)$, we have for $n>0$

$$f^{(n)}(x)=(-1)^{n+1}(n-1)!(x-3)^{-n} \tag 1$$

We will use this in Approach 2 of the expansions around both $x=0$ and $x=3$ in that which follows.

EXPANSION AROUND $x=0$

Approach 1: Using the approach outlined in the posted question, we find that

\begin{align} \log(3-x)&=-\int_2^x \frac{1}{3-t}dt\\\\ &=-\int_2^x\frac{1}{1-(t-2)}dt\\\\ &=-\sum_{n=0}^{\infty}\int_0^x (t-2)^n\\\\ &=-\sum_{n=1}^{\infty}\frac{(x-2)^n}{n} \end{align}

which converges for $-1\le x<3$ and diverges otherwise.

Approach 2: From $(1)$, we can see that $f^{(n)}(2)=(-1)^{n+1}(n-1)!(-1)^{-n}=-(n-1)!$

Therefore, we can write the series representation as

$$\log(3-x)=-\sum_{n=1}^{\infty}\frac{(x-2)^n}{n}$$

which converges for $-1\le x<3$ and diverges otherwise as expected!

EXPANSION AROUND $x=3$

Approach 1: Using the approach outlined in the posted question, we find that

\begin{align} \log(3-x)&=\log 3-\int_0^x \frac{1}{3-t}dt\\\\ &=\log 3-\frac13\int_0^x\frac{1}{1-(t/3)}dt\\\\ &=\log 3-\frac13\sum_{n=0}^{\infty}\int_0^x (t/3)^n\\\\ &=\log 3-\sum_{n=1}^{\infty}\frac{x^n}{n3^n} \end{align}

which converges for $-3\le x<3$ and diverges otherwise.

Approach 2: From $(1)$, we can also see that $f^{(n)}(0)=(-1)^{n+1}(n-1)!(-3)^{-n}=-\frac{(n-1)!}{3^n}$.

Therefore, we can write the series representation as

$$f(x)=\log 3-\sum_{n=1}^{\infty}\frac{x^n}{n3^n}$$

which converges for $-3\le x<3$ and diverges otherwise as expected!

• Please let me know how I can improve my answer. I really just want to give you the best answer I can. – Mark Viola Aug 17 '15 at 15:10


Given the GCD and LCM of n positive integers, how many solutions are there?

Question: Suppose you know $$G:=\gcd$$ (greatest common divisor) and $$L:=\text{lcm}$$ (least common multiple) of $$n$$ positive integers; how many solution sets exist?

In the case of $$n = 2$$, one finds that for the $$k$$ distinct primes dividing $$L/G$$, there are a total of $$2^{k-1}$$ unique solutions.

I am happy to write out a proof of the $$n = 2$$ case if desirable, but my question here concerns the more general version. The $$n=3$$ case already proved thorny in my explorations, so I would be happy to see smaller cases worked out even if responders are unsure about the full generalization.

Alternatively: If there is already an existing reference to this problem and its solution, then a pointer to such information would be most welcome, too!

• @Yorch Your comment only links to the question in the case where $n=2$; for me, this case was no trouble! I am asking, specifically, about the general case: Where you have positive integers $\{a_1, \ldots, a_n\}$. Sep 22 '21 at 15:53
• do you require that the $n$ positive integers be distinct? Are you trying to count the multisets? I think that is the only version I haven't been able to solve. Sep 22 '21 at 16:04
• @Yorch No requirement that the integers be distinct and/but (ideally!) counting distinct solutions. If you think that you can make traction on a modified version (i.e. imposing additional constraints) then I'd still be pleased to see what you come up with. Sep 22 '21 at 16:08

If you are interested in counting tuples $$(a_1,a_2,\dots,a_n)$$ such that $$\gcd(a_1,\dots,a_n) = G$$ and $$\operatorname{lcm}(a_1,\dots,a_n) = L$$ then we can do it as follows.

If $$L/G = \prod\limits_{i=1}^s p_i^{x_i}$$ then each $$a_i$$ must be of the form $$G \prod\limits_{j=1}^s p_i^{y_{i,j}}$$ with $$0 \leq y_{i,j} \leq x_i$$.

Hence for each prime $$p_i$$ we require that the function from $$\{1,\dots, n\}$$ to $$\mathbb N$$ that sends $$j$$ to $$y_{i,j}$$ be a function that hits $$0$$ and $$x_i$$.

The number of such functions is easy by inclusion-exclusion for $$x_i \geq 1$$, it is $$(x_i+1)^n - 2(x_i)^n + (x_i-1)^n$$.

It follows the total number of tuples is $$\prod\limits_{i=1}^s ( (x_i+1)^n - 2x_i^n + (x_i-1)^n)$$.

• Counting tuples as in, with repetition, right? E.g. $(1,2)$ and $(2,1)$ would each be counted in your computation? If so, isn't it the case that (using your notation) you could assign the $s$ distinct primes (to their various powers) as divisors of any of the $n$ integers or a subset of them (e.g. to $\{a_1, a_3, a_7\}$)? There are $2^n$ subsets of $\{a_1, \ldots, a_n\}$, but we exclude the full set (this is the $\gcd$) as well as the empty set for a total of $2^{n} - 2$ subsets. Assigning the aforementioned $s$ primes can now be done in in $s^{2^{n} - 2}$ ways. Or have I misunderstood? Sep 22 '21 at 17:17
• Yes, that is what it looks like when no prime appears more than once in $L/G$, you would get $(2^n-2)^s$@BenjaminDickman , when you have a prime with exponent greater than $1$ dividing $L/G$ it becomes more complex. Sep 22 '21 at 17:49
• lets consider $G=1$ and $L=8$ and $n = 3$. Here we must have that each $a_i$ is one of $1,2,4,8$, and we require that at least one of them is $1$ and at least one of them is $8$, there are $4^3$ total tuples, there are $3^3$ tuples that don't hit the value one, there are $3^3$ that don't hit the value $8$ and there are $2^3$ that don't hit etiher, so there are $4^3-2(3^3) + 2^3$ total triples that work. Sep 22 '21 at 18:08
• Ah, great! I have also been pointed to this same answer as Theorem 2.7 here: derby.openrepository.com/handle/10545/583372 (I may add an answer to this effect) Sep 22 '21 at 19:34
• The case $G,L$ is the same as the case $1,L/G$ Sep 23 '21 at 16:39

(Adding this community wiki answer to point out a relevant reference.) I was recently pointed to the following paper, in which this and related problems are proposed and solved:

Bagdasar, O. (2014.) "On some functions involving the lcm and gcd of integer tuples." Scientific Publications of the State University of Novi Pazar Series A: Applied Mathematics, Informatics and mechanics, 6(2):91-100. PDF (no paywall).

The result appears as Theorem 2.7 (cf. the comment of Yorch, too):


# Inferential logic in a simple-life situation.

Here's a little situation I want math to resolve for me :

1. If I study, I make the exam ,
2. If I do not play tennis, I study ,
3. I didn't make the exam

Can I conclude that was playing tennis ?

Trying to put this into the symbology of inference logic and propositional classic logic :

$P1 : \text{study} \implies \text{exam}$

$P2 : (\text{tennis}\, \vee \text{study}) \wedge (\neg \text{tennis} \implies \text{study})$ (disjunctive syllogism)

$p3 : \neg \text{exam}$

My reasoning :

Step 1 : the contrapositive of $P1$ is $P1' : \neg \text{exam} \implies \neg \text{study}$ ;

Step 2 : By Modus Tollens ( $[(P \implies Q) \wedge \neg Q] \implies \neg P$) we have : $(\text{study} \implies \text{exam}) \wedge (\neg \text{exam} \implies \neg \text{study})$

Step 3 : should we suppose : $\neg \text{tennis} \wedge \neg \text{study}$, then $\neg ( \text{tennis} \vee \text{study})$, then (by $P2$) $\text{tennis}$ or otherwise the $P1$ would fall since $\neg \text{study}$ and $\neg (False \implies False)$.

Step 4 : reductio ad absurdum from step $(3)$, we have $(\text{tennis} \vee \text{study})$, henceforth, in $P2$, $\neg \text{tennis}$ or else $false \implies false$.

So, have I been playing tennis or is my inferential logic bad ?

• The title should be more informative. – Paracosmiste Dec 25 '13 at 15:38
• Would the person that "minused" the question care to say why ? That would be nice ! – Gloserio Dec 25 '13 at 16:11
• I'm not the downvoter. – Paracosmiste Dec 25 '13 at 16:26
• I am not accusing either, and I've just asked the question to see what I can avoid next time :) – Gloserio Dec 25 '13 at 16:28

Yes, indeed, we can easily arrive at the conclusion that you played tennis: and the repeated use of modus tollens, alone (plus one invocation of double negation) gets you that conclusion.

Our premises, in "natural language":

1. If I study, I make the exam ,
2. If I do not play tennis, I study ,
3. I didn't make the exam

KEY:

$S:\;$ I study.

$E:\;$ I make the exam.

$P:\;$ I play tennis.

Then our premises translate to:

$(1): S \rightarrow E$.

$(2): \lnot P \rightarrow S.$

$(3): \lnot E.$

$(4)\quad \lnot S$ follows from $(1), (3)$ by modus tollens.

$(5)\quad \lnot \lnot P$ follows from $(2), (4)$ by modus tollens.

$\therefore (6) \quad P$, by $(5)$ and double negation.

Hence you can conclude you played tennis.

• As @Matt Brenneman did, you translated the second statement to : $\neg P \implies S$ while I've translated it to : $(P \vee S) \wedge \neg S \implies P$, which I thought was safer. Admitting your translation, I would totally agree with your reasoning, but admitting mine, would we come still to the conclusion that I play tennis ? – Gloserio Dec 25 '13 at 16:19
• Yes, absolutely you would! $\lnot P \rightarrow S \equiv \lnot \lnot P \lor S\equiv P \lor S$. Then since we have $\lnot S$, too, you can conclude $P$. – Namaste Dec 25 '13 at 16:36
• I know you love logic and for this reason this answer is excellent;-)+1 – user63181 Dec 25 '13 at 16:51
• @amWhy : thank you, now it's clear ! – Gloserio Dec 25 '13 at 18:16
• You're welcome, @Gloserio! – Namaste Dec 25 '13 at 18:23

You made a mistake in your step 3, because considering only P2, the term $\neg ( tennis \vee study)$ does not imply $tennis \vee study$.

This may sound counter-intuitive to your introduction.

The reason is, that your P2 is an arguable translation of statement 2. It is not equivalent to "if I don't play tennis, I study". Rather it states "if I don't play tennis and if I study, I study", which is a tautology. You can see this by drawing a truth-table for P2.

Also note that $\neg exam, \neg tennis, \neg study$ satisfies P1,P2 and P3.

So I would replace P2 by $$\neg tennis \rightarrow study.$$ This also repairs your Step3.

• +1, you're probably true, that why I've asked this question, because I felt as if my $P2$ was somewhat redundant. Thanks for pointing it out ! – Gloserio Dec 25 '13 at 16:26

Yes. It just reduces down to look at the contrapositives of your statements.
Statement 1 is logically equivalent to : ~(make exam) implies ~study.
Statement 2 is logically equivalent to: ~study implies (play tennis).
So the truth of ~(make exam) directly implies you played tennis (use modus ponens twice).

• How is second statement logically equivalent to $\neg study \implies tennis$ ? – Gloserio Dec 25 '13 at 15:52
• It is the contrapositive of the statement: "~(play tennis) implies study" – Matt Brenneman Dec 25 '13 at 15:54
• So how that you converted natural langage to logic symobols, and in its valid. – Gloserio Dec 25 '13 at 16:20


# calculating total number of allowable paths

I seem to be struggling with the following type of path questions

Consider paths starting at $$(0, 0)$$ with allowable steps

(i) from $$(x,y)$$ to $$(x+1,y+2)$$,

(ii) from $$(x,y)$$ to $$(x+2,y+1)$$,

(iii)from $$(x,y)$$ to $$(x+1,y)$$

Determine the total number of allowable paths from $$(0, 0)$$ to $$(8, 8)$$, and the total number of allowable paths from $$(0, 0)$$ to $$(10, 10)$$.

could anyone recommend a trivial method to tackle problems of these types in an exam setting?

• General answer for these type of problems would be to use recursion, as answered by Rob Pratt. However, in this "small" case it might be easier to do things "on hand", especially in exam setting. Suppose you do $A$ moves of type (i), $B$ of type (ii) and $C$ of type (iii). After putting constraints on $A, B, C$ you will see that there is only two possibilities in both of your question. Can you work out the rest by yourself? Apr 2, 2020 at 21:56
• I don't understand @prosinac Apr 2, 2020 at 22:44

Draw a table and think backwards. Let $$p(x,y)$$ be the number of such paths from $$(0,0)$$ to $$(x,y)$$. By conditioning on the last step into $$(x,y)$$, we find that $$p(x,y)=p(x-1,y-2)+p(x-2,y-1)+p(x-1,y),$$ where $$p(x,y)=0$$ if $$x<0$$ or $$y<0$$. You know that $$p(0,0)=1$$, and you want to compute $$p(8,8)$$ and $$p(10,10)$$. The resulting table is $$\begin{matrix} x\backslash y &0 &1 &2 &3 &4 &5 &6 &7 &8 &9 &10 \\ \hline 0 &1 &0 &0 &0 &0 &0 &0 &0 &0 &0 &0 \\ 1 &1 &0 &1 &0 &0 &0 &0 &0 &0 &0 &0 \\ 2 &1 &1 &2 &0 &1 &0 &0 &0 &0 &0 &0 \\ 3 &1 &2 &3 &2 &3 &0 &1 &0 &0 &0 &0 \\ 4 &1 &3 &5 &6 &6 &3 &4 &0 &1 &0 &0 \\ 5 &1 & &8 &12 &13 &12 &10 &4 &5 &0 &1 \\ 6 & & &12 & &27 &30 &26 &20 &15 &5 &6 \\ 7 & & & & &51 & &65 &60 &45 &30 &21 \\ 8 & & & & & & &146 & &\color{red}{130} &105 &71 \\ 9 & & & & & & & & &336 & &231 \\ 10 & & & & & & & & & & &\color{red}{672} \\ \end{matrix}$$ In particular, $$p(8,8) = p(7,6)+p(6,7)+p(7,8) = 65+20+45=130.$$

• How could you apply this with perhaps a path D: $(x,y)->(x,y-1)$ ? Apr 3, 2020 at 13:13
• You can use the same approach. The new recurrence has an additional $+p(x,y+1)$ term, and you should explicitly include a boundary condition $p(x,y)=0$ for $y>2x$ to avoid infinite descent. Apr 3, 2020 at 14:46

Suppose you do $$A$$ moves of type (i), $$B$$ of type (ii) and $$C$$ of type (iii). If you want to reach $$(8, 8)$$, then clearly $$A + 2B + C = 8$$ and $$2A + B = 8$$. This yields $$B = 8-2A$$ and $$C = 3A - 8$$. Since $$A, B, C$$ are nonnegative integers, you obtain solutions $$(A, B, C) = (3, 2, 1)$$ or $$(4, 0, 4)$$.

Now to calculate paths, for $$(4, 0, 4)$$ case, a path is described by string of four $$A$$s and four $$C$$s. For example, $$AAACCACC$$ is one such path. There is $${8 \choose 4} = 70$$ such paths.

For the $$(3, 2, 1)$$ case there is $${6 \choose 3} \cdot 3 = 60$$ such paths. Altogether there are $$130$$ such paths.

For reaching $$(10, 10)$$ same logic gives you $$B = 10 - 2A$$ and $$C = 3A - 10$$, so solutions are $$(4, 2, 2)$$ and $$(5, 0, 5)$$.

So, the number of paths is $${8 \choose 4} {4 \choose 2} + {10 \choose 5} = 70 \cdot 6 + 252 = 672$$.

This is in agreement with Rob Pratts answer. Also, I would like to emphasise as I did in the comment that his answer is "better" in a sense that it illustrates how you can handle any problem of this type, since his answers scales reasonably to larger numbers. This answer can from the practical point of view only be used on such a small examples. But, if I was writing an exam, I'd take this approach (or at least I would try and then estimate would it be faster done this way or in the more general way)

• +1 I like these kind of "restrict by case" approaches too. It is not that hard to scale for larger numbers as there is a pattern, though the calculation could be tedious. E.g It works nicely for This question. Apr 3, 2020 at 0:08
• If you prefer multinomial coefficients to binomial coefficients, the formulas are $\binom{6}{3,2,1}+\binom{8}{4,4}$ and $\binom{8}{4,2,2}+\binom{10}{5,5}$. Apr 3, 2020 at 1:24
• I understand everything but where has A+2B+C=8 and 2A+B=8 come from? I don't seen how 8 can be reached using these steps? @prosinac Apr 3, 2020 at 16:58
• If you do $A$ moves of type (i) then you moved $A$ steps on the $x$-axis. If you do $B$ moves of type (ii) then you moved $2B$ steps on the $x$-axis. If you do $C$ moves of type (iii) then you moved $C$ steps on the $x$-axis. And you must move $8$ steps in total. So $A+2B+C=8$. Same logic for $y$-axis gives second equation Apr 3, 2020 at 21:26


# Math Help - Piecewise-Defined Function

1. ## Piecewise-Defined Function

For both questions below:

(a) Find the domain of the function.

(b) Locate any intercepts.

(1)

.....{3 + x......if -3 <or= to x < 0
f(x){3...........if......x = 0
.....{Sqrt{x}..if......x > 0

=======================

(2)

..........{1/x.........if.....x < 0
f(x) = {sqrt{x}...if.....x >or= to 0

NOTE: It is hard to correctly type the piecewise-defined functions using a regular keyboard.

I hope you can understand the above.

2. Originally Posted by symmetry
For both questions below:

(a) Find the domain of the function.

(b) Locate any intercepts.

(1)

.....{3 + x......if -3 <or= to x < 0
f(x){3...........if......x = 0
.....{Sqrt{x}..if......x > 0

=======================

(2)

..........{1/x.........if.....x < 0
f(x) = {sqrt{x}...if.....x >or= to 0

NOTE: It is hard to correctly type the piecewise-defined functions using a regular keyboard.

I hope you can understand the above.
I'll do the first one for you- graph it. The conditions are the "if" parts in the piece-wise function. Domain is (-3, inf) and there are no intersepts. Try graphing it. You have a line with slope = 1 and an exponential function.

EDIT: Sorry, there are x and y-intercepts, as Soroban pointed out, although the two graphs do not not intersect which is what I was getting at.

3. Hello, symmetry!

For both questions below:
. . (a) Find the domain of the function.
. . (b) Locate any intercepts.

Did you make a sketch?

$(1)\;\;f(x) \:=\:\begin{Bmatrix} 3 + x & &\text{if }\text{-}3 \leq x < 0 \\ 3 & &\text{if }x = 0 \\ \sqrt{x} & &\text{if }x > 0 \end{Bmatrix}$
Code:
                |
|            *
*      *
* |  *
*   |*
----*-----o--------------
-3     |
Domain: . $(\text{-}3,\,\infty)$

Intercepts: . $(\text{-}3,0),\:(0,3)$

$(2)\;\;f(x)\:=\:\begin{Bmatrix}\frac{1}{x} & & \text{if }x < 0 \\ \sqrt{x} & & \text{if }x \geq 0 \end{Bmatrix}$
Code:
                      |
|            *
|      *
|   *
|*
------------------*----------------
*               |
*         |
*    |
*  |
* |
|
*|
|
Domain: . $(-\infty,\,\infty)$

Intercepts: . $(0,\,0)$

4. ## ok

Thank you again both for your quick replies.

To soroban,

No, I did not sketch the graph because I do not know how to graph piecewise-defined functions.

I understand these functions are graphed in parts, right?

Can you take me through a sample graphing question in terms of this type of function?

Thanks!

5. Originally Posted by symmetry
Thank you again both for your quick replies.

To soroban,

No, I did not sketch the graph because I do not know how to graph piecewise-defined functions.

I understand these functions are graphed in parts, right?

Can you take me through a sample graphing question in terms of this type of function?

Thanks!

Yes, they are 'graphed in parts,' I guess you could call it.

For instance,

Take the first condition;

f(x) = 3 + x if -3 <= x < 0

From x = -3 (including this point) to x = 0 (not including, and thus draw an open circle by this point), you will graph 3 + x; see Soroban's graph. The reason why it's closed (solid dot) is because of the next condition later, and thus includes that point. Try look up piece-wise functions on Wikipedia.

6. ## ok

I like graphing functions. I think piecewise-defined functions are cool but not easy to sketch.

Thanks!

7. Hello again, symmetry!

Okay, here's an example.

. . $f(x) \:=\:\begin{Bmatrix}3 & \text{if }0 \leq x \leq 1 \\ 2x + 1 & \text{if }x > 1\end{Bmatrix}$

When $x$ is between $0$ and $1$ (including the endpoints),
. . the graph is $f(x) = 3$, a horizontal line.
Code:
        |
3* * * * *
|
|
- + - - - + - -
|       1

When $x$ is greater than 1, the graph is $f(x) \:=\:2x + 1$,
. . a slanted line.
Code:
        |
|                   *
|                *
|             *
|          *
3|       *
|
|
- + - - - + - - - - - - -
|       1

Sketch them on the same graph
. . and have the graph of the piecewise function.
Code:
        |
|                   *
|                *
|             *
|          *
3o * * * *
|
|
- + - - - + - - - - - - -
|       1

This function could be your long-distance charge.

They might charge $3 for the first minute . . and$2 per minute for every subsequent minute.

(Hmmm, not a good example . . .
I'm sure someone will point out why.)


# Mellin transform of $x^p$ seems to miss a factor of $2\pi$

Bug introduced in 11.1 or earlier and fixed in 11.3

On Mathematica 11.1.1.0 the Mellin transform of $x^p$ is evaluated as $\delta(p+s)$, while I think it should be $2\pi\,\delta(p+s)$:

In:= MellinTransform[x^p, x, s, GenerateConditions -> True]
Out:= DiracDelta[p + s]

edited posting after Daniel Lichtblau's comment

I initially did not understand this result, but this 2004 paper has explained to me how to arrive at the Dirac delta function, however, with an additional factor of $2\pi$. I checked that this is not a matter of a different definition of the Mellin transform. (I summarized the calculation in this Mathoverflow posting.)

Missing factor $2\pi$ is fixed in Mathematica 11.3.0:

 In:= MellinTransform[x^p, x, s, GenerateConditions -> True]
Out:= 2π DiracDelta[i(p + s)]

consequence: before 11.3 Integrate[MellinTransform[1, x, s], {s, -Infinity, Infinity}] returned 1, now it returns $2\pi\int_{-\infty}^\infty\delta(is)ds$
Q: is this v. 11.3 change in the implementation of MellinTransform documented somewhere?

• See last example in documentation under Scope Elementary Functions. It should be noted that this is a generalization of the integral definition, not unlike the case for FourierTransform. – Daniel Lichtblau Jul 9 '17 at 15:27
• thank you, Daniel, for the feedback, I understand things a bit better now and have edited my posting accordingly --- my problem has been reduced to a missing factor $2\pi$... – Carlo Beenakker Jul 9 '17 at 19:06
• What specific definition is used is not particularly important so long as the MellinTransform and InverseMellinTransform are inverses of each other. Both x^p == InverseMellinTransform[ MellinTransform[x^p, x, s], s, x] and DiracDelta[p + s] == MellinTransform[ InverseMellinTransform[DiracDelta[p + s], s, x], x, s] evaluate to True – Bob Hanlon Jul 9 '17 at 22:41
• @BobHanlon --- but if we assume that the factor of $2\pi$ is absorbed in the definition of DiracDelta, then Integrate[MellinTransform[1, x, s], {s, -Infinity, Infinity}] should return $2\pi$, while instead it returns 1. – Carlo Beenakker Jul 10 '17 at 6:18
• The integral of DiracDelta should be one. – Bob Hanlon Jul 10 '17 at 14:48

The Mellin transforms for $x^j$ reported by Mathematica 11.2 didn't make sense to me, so on 11/28/2017 I submitted the following question on Math StackExchange.

Questions on Mellin Transform of $x^j$ and Interpretation of Distributions with Complex Arguments

I ended up deriving the answer to my own question and on 12/7/2017 I submitted a problem report to Wolfram technical support where I attached a Mathematica notebook illustrating the problem and the correct solution (CASE:3980660).

I received an email from Wolfram technical support on 12/13/2017 indicating my analysis was accepted as correct and a report was being filed with the developers. The correct solution was subsequently implemented in Mathematica 11.3.

Note that not only was the $2\,\pi$ prefix missing, but $i$ was also missing in the $\delta$ function parameter.

I subsequently posted the correct solution in answers to related questions on both Math StackExchange and MathOverflow StackExchange.

Delta function with imaginary argument

Dirac Delta function with a complex argument


# Finding Horizontal Tangent Planes on S

1. Dec 2, 2011

### TranscendArcu

1. The problem statement, all variables and given/known data
S is the surface with equation $$z = x^2 +2xy+2y$$a) Find an equation for the tangent plane to S at the point (1,2,9).
b) At what points on S, in any, does S have a horizontal tangent plane?

3. The attempt at a solution
$$F(x,y,z): z = x^2 +2xy+2y$$
$$F_x = 2x + 2y$$
$$F_y = 2x + 2$$

Evaluated at (1,2) gives answers 6 and 4, respectively. My equation for a plane is:

$$z-9=6(x-1) + 4(y-1)$$.

I think any horizontal plane should have normal vector <0,0,k>, where k is some scalar. I'm pretty sure that S has no such normal vector. But if
$$F(x,y,z): 0 = x^2 +2xy+2y - z$$
then
$$grad F = <2x + 2y,2x + 2,-1>$$ It seems like I can let (x,y) = (-1,1) to zero the x-, y-components of the gradient. Plugging (-1,1) into the definition of z gives z = 1. This suggests to me that there is a point (-1,1,1), at which there is a horizontal tangent plane. Yet I feel pretty sure that this isn't true!

2. Dec 3, 2011

### ehild

You made a little mistake when writing out the equation of the tangent plane. The y coordinate of the fixed point is 2, you wrote 1.

A surface in 3D is of the form F(x,y,z) = constant. For this surface, x2+2xy+2y-z=0. That means F(x,y,z)=x2+2xy+y-z. The gradient of F is normal to the surface, and the tangent plane of the surface at a given point. You want a horizontal tangent plane, so a vertical gradient:(0,0,a). That means Fx=2x+2y=0, Fy=2x+2=0 --->x=-1, y=1, so your result for the x,y coordinates are correct. Plugging into the original equation for x and y, you got z=x2+2xy+2y=1, it is correct. Why do you feel it is not?

ehild

3. Dec 3, 2011

### TranscendArcu

When I graphed F(x,y,z) in MatLab (and it's possible I graphed it incorrectly), I observed that the the resulting paraboloid is always "tilted". Below is a picture from my plot:
http://img440.imageshack.us/img440/687/skjermbilde20111203kl85.png [Broken]
How can this surface have a horizontal tangent anywhere when it is tilted like this?

Last edited by a moderator: May 5, 2017
4. Dec 3, 2011

### ehild

Try to plot z out for -2<x<0 and 0<y<2

ehild

5. Dec 3, 2011

### TranscendArcu

http://img7.imageshack.us/img7/139/skjermbilde20111203kl10.png [Broken]
Hmm. I'm not seeing the a point in this picture where the gradient is pointing directly upwards. Everything still looks kind of tilted.

Last edited by a moderator: May 5, 2017
6. Dec 3, 2011

### ehild

The function is equivalent with z=(x+2y-1)(x+1)+1 and z=1 along the lines x=-1 and y=(1-x)/2. I attach a plot of the surface near the point (-1,1)

ehild

File size:
81.6 KB
Views:
127
7. Dec 4, 2011

### HallsofIvy

Staff Emeritus
I presume that by "horizontal" you mean perpendicular to the z-axis.

The simplest way to find a tangent planes for a surface is to write it in the form F(x,y,z)= constant. Then the normal to the tangent plane at any point is given by $\nabla F$. Here, you can write $F(x, y,z)= x^2+ 2xy+ 2y- z= 0$.

What is $\nabla F$? That will be vertical (and so tangent plane horizontal) when its x and y components are 0.

8. Dec 4, 2011

### ehild

@HallsofIvy: The OP has shown the solution in his first post, he only can not believe it, as the surfaces he got with MatLab look tilted. If you could give advice how to plot surfaces with MatLab, that would be real help for him.

ehild

9. Dec 4, 2011

### TranscendArcu

If anyone is familiar with MatLab, this is the code I've been using:

Note that the "%" mark my annotations. I included them so that hopefully you can follow what I'm doing more easily.

10. Dec 4, 2011

### TranscendArcu

Ha! I figured it out. I forgot a "."

I should have written

z = x.^2 + 2*x.*y +2*y;

Everything makes sense now.

11. Dec 4, 2011

### ehild

You see: it is worth typing something out again and again. Is your plot similar to my one? It was made with Origin. I would like to see your final plot... Please...

ehild

12. Dec 4, 2011

### TranscendArcu

http://img259.imageshack.us/img259/2104/skjermbilde20111204kl10.png [Broken]It looks like it could have a horizontal tangent plane right around (-1,1,1)

Last edited by a moderator: May 5, 2017
13. Dec 4, 2011

### ehild

It is really nice!!! And a missing dot made you sceptical about the truth of Maths??!!!:uhh:

ehild