{NotebookFileName[],DateString[]}

Notes

Sound@SoundNote["A4",5]

EmitSound[Sound[SoundNote["A4",5]]]

Mobius bugs

n[
T_
]:=
10(T^2)-40T+200

T[
t_
]:=
4t+10

n[T[t]]

n[T[t]]//Expand

Solve[n[T[t]]==2720, t]

Solve[n[T[t]]==5920, t]

Solve[n[T[t]]==10400, t]

800+640t+160(t^2)/.t->4

n[T[4]]

Assuming[x>0,((Sqrt[(x^6)])/(x^(6/5)))//Simplify]

3-6/5

Domain of (Sqrt[(r^2)-(((x-h))^2)])

(r^2)-(((x-h))^2)≥ 0
(((x-h))^2)-(r^2)≤0
((x-h)-r)((x-h)+r)≤0
(x-(h+r))(x-(h-r))≤0

When is x-(h+r) negative? When x<h+r When is x-(h-r) negative? When x<h-r.

styletext[
t_
]:=
Style[t,Bold,FontFamily->"Arial",FontSize->14]

Block[{is=400,h=0,r=1,lim=3},
Graphics[{
Thick,PointSize[Large],
{Red,Point[{h,0}],
Text[styletext["h"],{h,0},{0,-1}]},
{Red, Arrow[{{h+r,0},{-lim,0}}],
Text[styletext["x-(h+r)<0"],{((h+r-lim)/2),0},{0,-1}]},
{Black, Arrow[{{h+r,0},{lim,0}}],
Text[styletext["x-(h+r)>0"],{((h+r+lim)/2),0},{0,-1}]},
Text[styletext["h+r"],{h+r,0},{0,-1}],
Point[{h+r,0}],
Point[{h,-1}],
Text[styletext["h"],{h,-1},{0,-1}],
{Red, Arrow[{{h-r,-1},{-lim,-1}}],
Text[styletext["x-(h-r)<0"],{((h-r-lim)/2),-1},{0,-1}]},
{Black, Arrow[{{h-r,-1},{lim,-1}}],
Text[styletext["x-(h-r)>0"],{((h-r+lim)/2),-1},{0,-1}]},
Point[{h-r,-1}],
Text[styletext["h-r"],{h-r,-1},{0,-1}]
},
ImageSize->is
]
]

Block[{is=400,h=0,r=1,lim=3},
Graphics[{
Thick,PointSize[Large],
{Red, Arrow[{{h+r,0},{-lim,0}}],
Text[styletext["x-(h+r)<0"],{((h+r-lim)/2),0},{0,-1}]},
{Black, Arrow[{{h+r,0},{lim,0}}],
Text[styletext["x-(h+r)>0"],{((h+r+lim)/2),0},{0,-1}]},
Text[styletext["h+r"],{h+r,0},{0,-1}],
Point[{h+r,0}],
{Red, Arrow[{{h-r,-1},{-lim,-1}}],
Text[styletext["x-(h-r)<0"],{((h-r-lim)/2),-1},{0,-1}]},
{Black, Arrow[{{h-r,-1},{lim,-1}}],
Text[styletext["x-(h-r)>0"],{((h-r+lim)/2),-1},{0,-1}]},
Point[{h-r,-1}],
Text[styletext["h-r"],{h-r,-1},{0,-1}],
Text[styletext["("],{h-r,-1.5},{0,0}],
Text[styletext[")"],{h+r,-1.5},{0,0}],
Text[styletext["1 neg factor"],{h,-1.5},{0,0}]
},
ImageSize->is
]
]

Block[{is=400,h=0,r=1,lim=3},
Plot[(r^2)-(((x-h))^2),{x,-lim,lim}
,PlotLegends->{"(r^2)-(x-h)^2"}
,Epilog->{
Thick,PointSize[Large],
{Black, Arrow[{{h+r,0},{lim,0}}],
Text[styletext["x-(h+r)>0"],{((h+r+lim)/2),0},{0,-1}]},
Text[styletext["h+r"],{h+r,0},{0,-1}],
Point[{h+r,0}],
{Red, Arrow[{{h-r,0},{-lim,0}}],
Text[styletext["x-(h-r)<0"],{((h-r-lim)/2),0},{0,-1}]},
{Red, Thickness[0.02],Line[{{h-r,0},{h+r,0}}]},
{Black,Thickness[0.01], Line[{{h-r,0},{h+r,0}}]},
Point[{h-r,0}],
Text[styletext["h-r"],{h-r,0},{0,-1}]
},
ImageSize->is
]
]

Invert tanh(x)

y=(((e^x)-(e^(-x)))/((e^x)+(e^(-x))))
x=(((e^y)-(e^(-y)))/((e^y)+(e^(-y))))
0=1-1=(((e^y)+(e^(-y)))/((e^y)+(e^(-y))))-1
x=(((e^y)-(e^(-y)))/((e^y)+(e^(-y))))+0
x=(((e^y)-(e^(-y)))/((e^y)+(e^(-y))))+(((e^y)+(e^(-y)))/((e^y)+(e^(-y))))-1
x=(((e^y)-(e^(-y))+(e^y)+(e^(-y)))/((e^y)+(e^(-y))))-1
x=((2(e^y))/((e^y)+(e^(-y))))-1
x+1=((2(e^y))/((e^y)+(e^(-y))))
1=((e^(-y))/(e^(-y)))
x+1=((2(e^y))/((e^y)+(e^(-y))))·1
x+1=((2(e^y))/((e^y)+(e^(-y))))·((e^(-y))/(e^(-y)))
x+1=((2(e^y)(e^(-y)))/(((e^y)+(e^(-y)))(e^(-y))))
x+1=(2/((1+(e^(-2y)))))
(x+1)(1+(e^(-2y)))=2
x+1+(e^(-2y))(x+1)=2
(e^(-2y))(x+1)=2-x-1
(e^(-2y))=((1-x)/(1+x))
ln((e^(-2y)))=ln(((1-x)/(1+x)))
-2y=ln(1-x)-ln(1+x)
y=(1/2)(ln(1+x)-ln(1-x))

ArcTanh[x]//TrigToExp

ArcTanh[1]

ArcTanh[-1]

Exp[ArcTanh[x]]//TrigToExp//Simplify

Assuming[
-1<x<1,
Solve[x==Tanh[y],y,Reals]//TrigToExp//Simplify
]

Assuming[
-1<x<1,
Solve[x==Exp[Tanh[y]],y,Reals]//TrigToExp//Simplify
]

Assuming[
-1<x<1,
Solve[x==Log[Tanh[y]],y,Reals]//TrigToExp//Simplify
]

Let f be any function whose domain is ℝ. Find an odd function (Subscript[f, o]) and an even function (Subscript[f, e]) such that f=(Subscript[f, o])+(Subscript[f, e]).

f(x)=(Subscript[f, o])(x)+(Subscript[f, e])(x)

f(-x)=(Subscript[f, o])(-x)+(Subscript[f, e])(-x)
=-(Subscript[f, o])(x)+(Subscript[f, e])(x)

Adding (1) and (2):

f(x)+f(-x)=2(Subscript[f, e])(x)
(Subscript[f, e])(x)=(1/2)(f(x)+f(-x))

Subtracting (2) from (1):

f(x)-f(-x)=2(Subscript[f, o])(x)
(Subscript[f, o])(x)=(1/2)(f(x)-f(-x))

Check. Is (Subscript[f, o]) odd?

(Subscript[f, o])(-x)=(1/2)(f(-x)-f(x))=-(1/2)(f(x)-f(-x))=-(Subscript[f, o])(x)

Is (Subscript[f, e]) even?

(Subscript[f, e])(-x)=(1/2)(f(-x)+f(x))=(1/2)(f(x)+f(-x))=(Subscript[f, e])(x)

Is f the sum of (Subscript[f, o]) and (Subscript[f, e])?

(Subscript[f, o])(x)+(Subscript[f, e])(x)=(1/2)(f(x)-f(-x)+f(x)+f(-x))=(1/2)(2f(x))=f(x)

Let f, g be periodic functions with minimum periods (Subscript[T, f]), (Subscript[T, g]). When is f+g periodic?

Suppose (Subscript[T, f])=(Subscript[T, g])=T. Then (f+g)(t+T)=f(t+T)+g(t+T)=f(t)+g(t). So clearly, f+g is periodic with period T.

Suppose (Subscript[T, f])=2(Subscript[T, g]). Then (f+g)(t+(Subscript[T, f]))=f(t+(Subscript[T, f]))+g(t+2(Subscript[T, g]))=f(t)+g(t). So in this case, f+g is periodic with period (Subscript[T, f])=2(Subscript[T, g]).

Suppose there is some number T such that (Subscript[T, f])=3T, (Subscript[T, g])=2T. Then,

(f+g)(t+6T)=f(t+6T)+g(t+6T)
=f(t+2(Subscript[T, f]))+g(t+3(Subscript[T, g]))
=f(t)+g(t)

So f+g is periodic with period 6T.

Suppose the ratio ((Subscript[T, f])/((Subscript[T, g]))) is a rational number (p/q), p,q∈ℤ,(p,q)=1,p,q>0. Then

((Subscript[T, f])/(Subscript[T, g]))=(p/q)
q (Subscript[T, f])=p (Subscript[T, q])

Let T=q (Subscript[T, f])=p (Subscript[T, q]). Then

(f+g)(t+T)=f(t+T)+g(t+T)
=f(t+q (Subscript[T, f]))+g(t+p (Subscript[T, f]))
=f(t)+g(t)

This, it turns out, is also a necessary condition for continuous nonconstant functions. If f and g are allowed to be discontinuous, this becomes a very hard question.

Function composition: iteration

Does it ever make sense to compose a function with itself, e.g. form the function (f∘f(x)=f(f(x))? This is called iteration. Of course, you can repeat it.

f1[
x_
]:=
(1/2)(x+2/x)

f1[1]

Let's look at the following function:

f(x)=(1/2)(x+(2/x))

What if we feed it 1?

f(1)=(1/2)(1+2)=(3/2)=1.5

{f1[f1[1]],N[f1[f1[1]]]}

Let’s feed that into f again:

f(f(1))=f((3/2))=(1/2)((3/2)+(4/3))=(17/12)≈1.41667

NestList[f1,1,5]

N[NestList[f1,1,5],10]

Again:

(f^3)(1)=f(f(f(1)))=f((17/12))=(1/2)((17/12)+(24/17))=(577/408)≈1.41422

Again:

(f^4)(1)=f(f(f(f(1))))=f((577/408))=(665857/470832)≈1.41421

Notice that if x∈ℚ, then f(x)∈ℚ, so the sequence formed this way is a sequence of rational numbers. Yet it converges to the irrational number (Sqrt[2]). Why?

First, note that f((Sqrt[2]))=(1/2)((Sqrt[2])+(2/(Sqrt[2])))=(1/2)(2(Sqrt[2]))=(Sqrt[2]).

Let us suppose x is close to, but a little big bigger than (Sqrt[2]). Then (2/x) will be close to (Sqrt[2]), but a little smaller. So we know that (Sqrt[2])∈(x,(2/x)). If I take the average of these two numbers, I get a number that is even closer to (Sqrt[2]) than x was. So by repeatedly applying f, we get a series of numbers that converge (very rapidly) to (Sqrt[2]). This method is called “divide and average”, or, more technically, Newton’s method applied to the square root.

You might notice that this also works for numbers other than 2, e.g. iteration of

g(x)=(1/2)(x+(5/x))

will converge to (Sqrt[5]). This is how your calculator and computer calculate square roots.

Assuming[
x>0,
Simplify[NestList[f1,x,4]]
]//TraditionalForm

((f1[x])^2)//Expand

((f1[x+(Sqrt[2])])^2)-2//Expand

((f1[x+(Sqrt[2])])^2)-2//Together

3(sin^2)(x)=1+cos(x)

Factor[-3(c^2)-c+2]

Solve[3((Sin[θ])^2)==1+Cos[θ],θ,Reals]

Fibonacci sequence and the golden ratio

FunctionExpand[Fibonacci[n]]

((((((1/2) (1+(Sqrt[5]))))^n)-((((2/(1+(Sqrt[5])))))^n) Cos[n π])/(Sqrt[5]))

FunctionExpand[GoldenRatio]

Assuming[
n∈Integers&&n≥1,
Simplify[Cos[n π]]
]

fib[
n_,
ϕ_:GoldenRatio
]:=
(1/(Sqrt[5]))((ϕ^n)-(((-ϕ))^(-n)))

fib[n]

Assuming[
n∈Integers&&n≥1,
Simplify[FunctionExpand@fib[n]]
]

{
Table[FullSimplify[fib[n]],{n,1,20}],
Table[FullSimplify[Fibonacci[n]],{n,1,20}]
}

fib[n,ϕ]+fib[n+1,ϕ]

FullSimplify[(1/(GoldenRatio-1))==GoldenRatio]

-(((-ϕ))^(-n))-(((-ϕ))^(-n))(((-ϕ))^(-1))==-(((-ϕ))^(-n))+(-(((-ϕ))^(-1-n)))//Simplify

-(((-ϕ))^(-n))(1+(((-ϕ))^(-1)))==-(((-ϕ))^(-n))+(-(((-ϕ))^(-1-n)))//Simplify

-(((-ϕ))^(-n))(1-(ϕ^(-1)))==-(((-ϕ))^(-n))+(-(((-ϕ))^(-1-n)))//Simplify

N[1-(ϕ^(-1))==(ϕ^(-2))/.ϕ->GoldenRatio]

FullSimplify[-(((-ϕ))^(-n))(ϕ^(-2))==-(((-ϕ))^(-n))+(-(((-ϕ))^(-1-n)))/.ϕ->GoldenRatio]

FullSimplify[-(((-ϕ))^(-n-2))==-(((-ϕ))^(-n))+(-(((-ϕ))^(-1-n)))/.ϕ->GoldenRatio]

So, -(((-ϕ))^(-n))+(-(((-ϕ))^(-n-1))) simplifies to -(((-ϕ))^(-n-2)), which is clearly what I need. What about (ϕ^n)+(ϕ^(n+1))? That is

FullSimplify[(ϕ^2)==1+ϕ/.ϕ->GoldenRatio]

Solve[(ϕ^2)==1+ϕ,ϕ]

N[Solve[(ϕ^2)==1+ϕ,ϕ]]

{fib[0],Fibonacci[0]}

If I know that ϕ+1=(ϕ^2), do I automatically know that 1-(ϕ^(-1))=(ϕ^(-2))? Dividing ϕ+1=(ϕ^2) by (ϕ^2) gives (ϕ^(-1))+(ϕ^(-2))=1, which can be rearranged to the desired form.

fib[1,ϕ]

ϕ+(ϕ^(-1))=(ϕ^2)-(ϕ^(-2))

FullSimplify[ϕ+(ϕ^(-1))==(Sqrt[5])/.ϕ->GoldenRatio]

(ϕ^2)-ϕ-1=0
(SubPlus[ϕ])+(SubMinus[ϕ])=1
(SubPlus[ϕ])(SubMinus[ϕ])=-1
(SubPlus[ϕ])-(1/(SubPlus[ϕ]))=1

FunctionExpand[GoldenRatio]

FunctionExpand[1/GoldenRatio==((2((Sqrt[5])-1))/4)]

FunctionExpand[1/GoldenRatio==(((Sqrt[5])-1)/2)]

FunctionExpand[1/GoldenRatio==(((Sqrt[5])+1)/2)-1]

FunctionExpand[1/GoldenRatio==GoldenRatio-1]

ϕ+(1/ϕ)/.ϕ->GoldenRatio//FullSimplify

Table[
((Fibonacci[n+1])/(Fibonacci[n])),
{n,1,10}
]

ListPlot[Table[
((Fibonacci[n+1])/(Fibonacci[n])),
{n,1,10}
]
,Joined->True
,Mesh->All
,PlotRange->All
]

Table[
((Fibonacci[n+1])/(Fibonacci[n])),
{n,1,10}
]//N

GoldenRatio//N

Assuming[
ϕ>1,
((fib[n+1,ϕ])/(fib[n,ϕ]))//FullSimplify
]

From Wolfram MathWorld, I learn that

(ϕ^n)=(Subscript[F, n])ϕ+(Subscript[F, n-1])
(ϕ^n)=(ϕ^(n-1))+(ϕ^(n-2))

ln(|x|)

FindRoot[Abs[Log[x]]==x,{x,0.5}]

NestList[N[Abs[Log[#]]]&,0.5,10]