This sandbox is intended for saving drafts of long, complex posts, especially posts whose composition takes a long time. It serves to localize to one thread the front-page "bumps" caused by edits to drafts of such posts, so that they may be easily ignored. Also, it helps to guard against losing longly-composed posts due to system crashes.

When you are happy with your draft here, you may simply copy the code and paste it to the desired location.

Proper Use of the Sandbox

  1. Do not post a new answer! We wish all the answers on this page to be owned by the Community user (so that only a non-sentient bot is informed of edits to these answers). Posting a new answer will make you the owner, meaning that you will be notified whenever another user makes an edit to that answer.

    The sandbox has been closed to prevent the creation of new answers. There are more than enough existing answers for users to edit over, and this will greatly reduce the frequency at which we request that the answers be disassociated from specific users.

  2. Do not delete answers! Deleting seems like a reasonable option, but there are no "hard deletions" on Stack Exchange, and users will sufficient privileges will still see your supposedly deleted postings. Deleted answers will be undeleted and cleared for the use of others.

  3. Do look for an answer which indicates that it is free and then edit it to your heart's content. If none appears available, take over the one that has been left unchanged the longest (which will appear at the bottom of the page if you order answers by "activity").

  4. Do not expect your draft to remain untouched for days. There are no guarantees that your draft will be the latest revision if you return days later. While users will try not to step over others' toes, it may happen that an unfinished draft is edited out. Your draft will, however, still exist as a revision of the answer it was made in. If your drafting is expected to take place over a longer period of time, either

    • take note of the URL of the answer provided by clicking the share button, or
    • save a copy of your draft locally (or even "in the cloud").
  5. Do clear your draft when you are finished. This includes removing all $\LaTeX$ from your answers. Replacing all code with a simple statement like

    This answer is free for anyone to use

    is sufficient. Periodically users may go through and free up answer slots that have not been edited in, say, over one month. But you can aid in the smooth running of this sandbox by clearing away your drafts when you are finished with them.

  6. Do not "claim" multiple answers concurrently. Since this post is closed, the answers are a limited resource. If you really must compose several long, complex posts at the same time, you can still use a single answer, separating the different drafts using Markup: horizontal rules (---) and/or headings (# Header 1 #) are natural choices.

  7. Do not create new such sandboxes. The point of having a unique such sandbox is that it minimizes the noise on the front page when the sandbox is edited. If there were multiple sandboxes they will frequently occupy numerous front page slots, pushing other topics off the front page, and increasing noise.


closed as off-topic by Arthur Fischer Sep 18 at 10:37

  • This question does not appear to be about Mathematics Stack Exchange or the software that powers the Stack Exchange network within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

I have added a [sandbox] tag to allow people ignore it more easily (via software support of ignoring tags), and since it seems that we have two sandboxes now, a tag may seem a bit more in place here. –  Asaf Karagila Jul 18 '12 at 8:35
(+1) For thinking outside the (sand)box. –  cardinal Jul 18 '12 at 19:40
At the suggestion of the moderators, I have gone and changed the associated owners of all the answers here to the Community user. This way, the original owners will not receive excess pings for each time another user uses the draft space for their work. Enjoy! –  Grace Note Oct 5 '12 at 14:45
To prevent crashes I've found the "Bookmarks to disable/enable MathJax", provided in here, pretty useful. –  leo Dec 17 '12 at 18:03
This "sandbox" is being closed to prevent the creation of new answers. To start a draft, simply edit one of the existing free answers. –  Arthur Fischer Sep 18 at 10:37

17 Answers 17

Attempt at evaluating $\displaystyle \int\dfrac{\cos x}{1+e^x}\mathrm{d}x$ using integration by-parts.

$$ \require{cancel} \begin{align} \text{Now, }\int \frac1{1 + e^x}\ \mathrm dx &= \int \frac{\left(1 + e^x - e^x\right)\ \mathrm dx}{1 + e^x}\\ &= \int\mathrm dx - \int \frac{\cancel{e^x}}{1 + e^x}\frac{\mathrm d\left(1 + e^x\right)}{\cancel{e^x}}\\ &= x - \ln(1 + e^x) \end{align} $$ Hence, applying by-parts, we get $$ \int \frac{\cos x}{1 + e^x}\ \mathrm dx = \cos x\Big(x - \ln(1+e^x)\Big) - \int(-\sin x)\Big(x -\ln(1+e^x)\Big)\ \mathrm dx\\ = x\cos x - \cos x \ln(1 + e^x) + \int x\sin x\ \mathrm dx - \int \sin x \ln(1 + e^x)\ \mathrm dx\\ = \cancel{x\cos x} - \cos x \ln(1 + e^x) \cancel{-x\cos x} + \int \cos x\ \mathrm dx - \int \sin x\ \ln(1+e^x)\ \mathrm dx\\ = \sin x - \cos x \ln(1 + e^x) -\sin x\int\ln(1+e^x)\ \mathrm dx + \int\cos x \left({\small \int \ln(1 + e^x)\ \mathrm dx}\right)\mathrm dx\quad $$

Now, let $$y_1 = \int \ln(1 + e^x)\cdot 1 \ \mathrm dx = x\ln(1 + e^x) - \int \frac{x\cdot e^x\ \mathrm dx}{1 + e^x} = \dots $$

Hence, $$\int \frac{\cos x}{1 + e^x} = (1-y)\sin x - \cos x \ln(1+e^x) + \int y\cos x \ \mathrm dx $$

The rest is trivial and left as an exercise to the reader.

Who am I kidding, it's impossible to use by-parts on this.

@Committingtoaname , sorry, forgot this was here. Is not going so well, can't find a way of clearly proving an important argument. –  Edvin Orlov Oct 11 at 3:46

$\frac{2t}{1-t^2}=\frac B{A-C}$


Answer for this question : Evaluating $\displaystyle\int_0^\infty\frac{\sin^4x}{x^4}\mathrm dx$

Applying multiple times integration by parts, we get \begin{align} \int_0^\infty\frac{\sin^4x}{x^4}\mathrm dx&=-\frac{1}{3}\left.\frac{\sin^4x}{x^3}\right|_0^\infty+\frac{4}{3}\int_0^\infty\frac{\sin^3x\cos x}{x^3}\mathrm dx\\[7pt] &=0-\frac{2}{3}\left.\frac{\sin^3x\cos x}{x^2}\right|_0^\infty+\frac{2}{3}\int_0^\infty\frac{3\sin^2x\cos^2 x-\sin^4x}{x^2}\mathrm dx\\[7pt] &=0+\frac{2}{3}\int_0^\infty\left(\frac{\sin^22x}{x^2}-\frac{\sin^2x}{x^2}\right)\mathrm dx\\[7pt] &=\frac{2}{3}\int_0^\infty\frac{\sin^2x}{x^2}\mathrm dx\\[7pt] &=\bbox[5pt,border:3px #FF69B4 solid]{\color{red}{\large\frac{\pi}{3}}} \end{align} This is the simple and elementary way you can get. Not too messy and confusing, though.


Definition A: Given $b\in\Bbb R$ we define a map $m\mapsto b^m$ from $\Bbb Z^{\ge 0}$ to $\Bbb R$ recursively by $b^0:=1,b^{m+1}:=b^m\cdot b.$

Observe that this map is increasing for $b>1,$ decreasing for $0<b<1,$ and constant for $b=1.$

Claim 1: For $b>1,$ the map from Definition A is unbounded above.

Proof: Given $m\in\Bbb Z^{>0},$ let $a_m:=b^m-b^{m-1},$ so that each $a_m>0.$ It is readily shown by induction on $m$ that for all $m\in\Bbb Z^{>0},$ we have $a_{m+1}=a_m\cdot b$ and $$b^m=1+\sum_{k=1}^m a_k,$$ so in particular, $$b^m\ge 1+\sum_{k=1}^m a_1=1+ma_1>ma_1.$$ Take any $y\in\Bbb R.$ By the Archimedean Property of Reals, since $a_1>0,$ then there is some $m\in\Bbb Z^{>0}$ such that $ma_1>y,$ and so $b^m>y.$ Since this holds for all $y\in\Bbb R,$ then the map is unbounded above, as desired. $\Box$

Claim 2: Given $m\in\Bbb Z^{\ge0},$ the map $\Bbb R^{>0}\to\Bbb R^{>0}$ given by $b\mapsto b^m$ is non-decreasing, and is increasing for $m\ne 0$.

Proof: It is readily seen that the map $b\mapsto b^0=1$ is nondecreasing, and that the map $b\mapsto b^1=b$ is increasing. Suppose for some $m>0$ that the map $b\mapsto b^m$ is increasing, and take $b,c\in\Bbb R$ with $0<b<c.$ We know that $b^m<c^m$ by inductive hypothesis. Since $0<b$ and $b^m<c^m,$ then $b^{m+1}:=b^m\cdot b<c^m\cdot b.$ Since $b<c$ and $0<c^m,$ then $c^m\cdot b<c^m\cdot c=:c^{m+1},$ and so $b^{m+1}<c^{m+1},$ as desired. $\Box$

Definition B: Given $c\in\Bbb R^{\ge1}$ and $n\in\Bbb Z^{>0},$ we define $c^{\frac1n}:=\sup\{b\in\Bbb R:b^n\le c\}.$ Note in particular that $1^n=1\le c,$ so $\{b\in\Bbb R:b^n\le c\}$ is non-empty, and by Claim 1 is bounded above, so that $c^{\frac1n}$ is well-defined for $n\in\Bbb Z^{\ge 2}$. Furthermore, observing that $b^1=b$ for any $b\in\Bbb R,$ we have $$c^{\frac11}:=\sup\{b\in\Bbb R:b^1\le c\}=\sup\{b\in\Bbb R:b\le c\}=c=c^1,$$ so that Definitions A and B agree, and $c^{\frac1n}$ is well-defined for all $n\in\Bbb Z^{>0}.$

Claim 3: Given $c\in\Bbb R^{\ge 1}$ and $n\in\Bbb Z^{>0},$ $x=c^{\frac1n}$ is a positive real solution to $x^n=c.$ Moreover, it is the unique such solution by Claim 2.

@cameronbuie How did this go? –  Committing to a challenge Oct 22 at 0:43
@Committingtoachallenge: I've not yet finished. Would you like me to tag you once I've done so? –  Cameron Buie Oct 22 at 2:14
@CameronBuie Yes :), what is it for? –  Committing to a challenge Oct 22 at 2:16

This answer is free for anyone to use.


$$\begin{align} I &=\int_0^1 \frac{x^3}{2(2-x^2)(1+x^2) + 3\sqrt{(2-x^2)(1+x^2)}}\,\mathrm dx\tag{1}\\ &=\frac12\int_0^1 \frac{t}{2(2-t)(1+t) + 3\sqrt{(2-t)(1+t)}}\,\mathrm dt\tag{2}\\ &=\frac13\int_{\sqrt2}^{1/\sqrt2} \frac{u^2-2}{(1+u)^2(u^2+1)}\,\mathrm du\tag{3}\\ &=\frac13\left[\int_{\sqrt2}^{1/\sqrt2} \frac{3 u}{2 \left(u^2+1\right)}\,\mathrm du -\int_{\sqrt2}^{1/\sqrt2} \frac{3}{2 (u+1)}\,\mathrm du -\int_{\sqrt2}^{1/\sqrt2} \frac{1}{2 (u+1)^2}\,\mathrm du\right]\tag{4}\\ &=\frac13\left[\frac{3}{4} \log \left(u^2+1\right)-\frac{3}{2} \log (u+1)+\frac{1}{2 (u+1)}\right]_{\sqrt2}^{1/\sqrt2}\tag{5}\\ &=\frac{1}{3}\Bigg[\frac{3-2 \sqrt{2}}{2}\Bigg]\tag{6}\\ \end{align}$$

$$\large\int_0^1 \frac{x^3}{2(2-x^2)(1+x^2) + 3\sqrt{(2-x^2)(1+x^2)}}\,\mathrm dx=\frac{1}{6}\left(3-2 \sqrt{2}\right)$$


$(2)$ Substitute $x^2=t\iff2x\,\mathrm dx=\,\mathrm dt$

$(3)$ Using Type $\rm II$ Euler Substitution

$$\small \sqrt{(2-t)(t+1)}=(t+1)u \iff t+1=\frac{3}{u^2+1} \iff t=\frac{2-u^2}{u^2+1} \iff \,\mathrm dt=-\frac{6 u}{\left(u^2+1\right)^2}\,\mathrm du$$

$(4)$ Using Partial Fraction Decomposition

$$\small\frac{2-u^2}{(1+u)^2(u^2+1)}=-\frac{3 u}{2 \left(u^2+1\right)}+\frac{3}{2 (u+1)}+\frac{1}{2 (u+1)^2}$$


This answer is free for anyone to use

@committingtoaname: no, and I'd actually forgotten this was here. For one, I realized that there were some errors in what is here; moreover, achielle hui's comments in that question both shows the location I was heading and why it's hard to proceed further. So I abandoned this direct route. –  Semiclassical Oct 8 at 2:04

Since $\mathbb{Z} \oplus \mathbb{Z}_p$ is not isomorphic to $\mathbb{Z} \times \mathbb{Z}_{p^2}$ (one has an element of order $p^2$; the other does not), then your reasoning can't be correct. In fact, the pullback $P$ is actually isomorphic to a proper subgroup of the product $\mathbb{Z} \times \mathbb{Z}_{p^2}$. Since the diagram must commute, given $(x,y) \in P \subseteq \mathbb{Z} \times \mathbb{Z}_{p^2}$, we must have $g(x) = f(y)$, i.e., $x \equiv y \pmod{p}$. Can you show that $P = \{(x,y) \in \mathbb{Z} \times \mathbb{Z}_{p^2} : x \equiv y \pmod{p}\}$ and that $P$ is isomorphic to $\mathbb{Z} \oplus \mathbb{Z}_p$?


This answer is free for your use!

We can split the set of bit strings of length $n$ into two groups.

  1. Those has at least $k$ consecutive $1$s.
  2. Those has at most $k-1$ consecutive $1$s.

Let $N_n$ and $M_n$ be the number of bit strings in each group. It is clear the number we want to calculate is

$$N_n = 2^n - M_n$$

Let $X_n$ stand for any bit string in the second group. We have following possibilities:

$$\begin{array}{rcl} X_n &=& 0 X_{n-1} \\ &\text{or}& 10 X_{n-2} \\ &\vdots&\\ &\text{or}& \underbrace{1..1}_{k-1}0 X_{n-k} \end{array}\quad\text{ for } n \ge k $$ This translates to a recurrence relation of $M_n$:

$$M_n = M_{n-1} + \cdots + M_{n-k}\quad\text{ for } n \ge k\tag{*1}$$

Notice for $0 \le n < k$, we have $M_n = 2^n$. We can extend the validity of $(*1)$ to $n \ge 0$ by defining

$$M_{-1} = 1\quad\text{ and }\quad M_{-2} = \cdots M_{-k} = 0$$

If one compare this to the recurrence relation satisfied by

We find

$$M_n = F^{(k)}_{n+2} \quad\implies\quad N_n = 2^n - F^{(k)}_{n+2}$$

where $F^{(k)}$ is the $k$-step Fibonacci sequence.

For examples,

$$\begin{array}{rcl} (M_n)_{k=2} &=& (\color{red}{1,2,3,5,8,13,21,34,55,89,144},\ldots)\\ &\text{ vs }&\\ \text{Fibonacci numbers } (F_n) & = & (0, 1,\color{red}{1,2,3,5,8,13,21,34,55,89,144},\ldots)\\ \\ (M_n)_{k=3} &=& (\color{red}{1,2,4,7,13,24,44,81,149,274,504},\ldots)\\ &\text{ vs }&\\ \text{Tribonacci numbers } (T_n) & = & ( 0, 1, \color{red}{1, 2, 4, 7, 13, 24, 44, 81, 149,274,504},\ldots)\\ \\ (M_n)_{k=4} &=& (\color{red}{1,2,4,8,15,29,56,108,208,401,773},\ldots)\\ &\text{ vs }\\ \text{Tetranacci numbers } (T_n) & = & ( 0, 1, \color{red}{1, 2, 4, 8, 15, 29, 56, 108, 208, 401, 773},\ldots) \end{array} $$


This answer is free for anyone to use


This answer is free for anyone to use


This answer is free for anyone to use.


As an example we take the detailed exact cover sample from wikipedia


$$U=\{1,2,3,4,5,6,7\} \\ \begin{eqnarray} S_1 &=& \{1, 4, 7\} \\ S_2 &=& \{1, 4\} \\ S_3 &=& \{4, 5, 7\} \\ S_4 &=& \{3, 5, 6\} \\ S_5 &=& \{2, 3, 6, 7\} \\ S_6 &=& \{2, 7\} \end{eqnarray} $$

We have to calculate the numbers $a_j$ assigned to every $S_j$.

So first we calculate $a_1$ that is assigned to $S_1$. We write $N_d$ for a number represented in base $d$. So $$26=26_{10}=11010_2=222_3=1A_{1}$$

We use the base $d=7$, because the base must be (at least) one greater then the number of sets of the cover. To find the number assigned to $S_1$ we write the elements of U in descending order : $$\begin{array}\\ 7&6&5&4&3&2&1 \end{array}$$. Now we write 1 $1$ under each element that is contained in the set $S_1$ and get $$\begin{array}\\ 7&6&5&4&3&2&1 \\ 1& & &1& & &1 \end{array}$$ Under the elements of U that are not in $S_i$ we write a $0$ and get

$$\begin{array}\\ 7&6&5&4&3&2&1 \\ 1&0&0&1&0&0&1 \end{array}$$

So the assigned number is $$1001001_7=117993$$

The remaining numbers are calculated in a similar way and we get

$$\begin{array}{lcrcr} \\ a_1&=&1001001_7 &=& 11 7993\\ a_2&=& 1001_7 &=& 344\\ a_3&=&1011000_7 &=& 12 0393\\ a_4&=& 110100_7 &=& 1 9257\\ a_5&=&1100110_7 &=& 13 4512\\ a_6&=&1000010_7 &=& 11 7656\\ \end{array}$$ and further $$ b=1111111_7=13 7257 $$

To solve the exact cover problem we have to solve the 0-1-knapsack problem

$$117993 \, x_1 +344 \, x_2 +120393 \, x_3 +19257 \, x_4 +134512 \, x_5 +117656 \, x_6 =13 7257$$

The only solution for this knapsack is $$344+19257+117656=137257$$ so $$a_2+a_4+a_6=b$$

or, written in base $7$

$$\begin{array}{rr}\\ & 1001_7 \\ +& 110100_7 \\ +&1000010_7 \\ \hline{} &1111111_7 \end{array}$$

(note that for each place there is exactly one row with a $1$ on this place)

This means that $\{S2,S4,S6\}$ is an exact cover, which complies with our result.


This answer is free for anyone to use.