JupyterImageResolution = 84; JupyterOutTextForm = "TeX"; TeX[x_] := ToString[TeXForm[x]] TeX[x_, y__] := StringJoin[TeX[x], TeX[y]] TeXRaw[x__, y_] := StringJoin[x, TeX[y]] MappedBy[x_] := x MappedBy[x_, F___, G_] := MappedBy[x, F] // G SetAttributes[TeXEq, HoldFirst] TeXEq[x_] := TeX[HoldForm[x] == MappedBy[x, ReleaseHold, FullSimplify]] TeXEq[x_, F__] := TeX[HoldForm[x] == MappedBy[x, ReleaseHold, F]] Clear[f,x,a,b, JupyterImageResolution] Integrate[f[x], {x,a,b}] JupyterImageResolution = 72; Integrate[f[x], {x,a,b}] JupyterImageResolution = 84; Integrate[f[x], {x,a,b}] Clear[JupyterOutTextForm] (* default *) Integrate[f[x], {x,a,b}] // TeX JupyterOutTextForm = "Plain"; Integrate[f[x], {x,a,b}] // TeX JupyterOutTextForm = "TeX"; Integrate[f[x], {x,a,b}] // TeX A = {{0,-1},{1,0}}; A // TeX["A=",#]& MatrixExp[theta A] // TeXEq JupyterOutTextForm = "Plain"; $Version JupyterImageResolution = 84 JupyterOutTextForm = "TeX" Plot3D[Sin[x y], {x, -Pi, Pi}, {y, -Pi, Pi}] Integrate[Log[Sin[x]], x] Integrate[Log[Sin[x]], x] // TeXEq pendulum = {y''[x] + Sin[y[x]] == 0, y[0] == 2, y'[0] == 1}; solpendulum = NDSolve[pendulum, y, {x, -10, 10}] Plot[y[x] /. solpendulum, {x, -10, 10}] Plot[Evaluate[{y[x], y'[x], y''[x]} /. solpendulum], {x, -10, 10}] ParametricPlot[Evaluate[{y[x], y'[x]} /. solpendulum], {x, -10, 10}] manipulatependulum = Manipulate[ Module[ {sol = NDSolve[{y''[x] + Sin[y[x]] == 0, y[0] == p[[1]], y'[0] == p[[2]]}, y, {x, 0, T}]}, ParametricPlot[Evaluate[{y[x], y'[x]} /. sol], {x, 0, T}, PlotRange -> {{-2Pi, 2Pi}, {-3, 3}}] ], {{p, {2, 1}}, Locator}, {{T, 5}, 0, 20} ] Export["manipulatependulum.nb", manipulatependulum] we = {D[u[t,x],t,t] == D[u[t,x],x,x], u[0,x]==Exp[-x^2/2], Derivative[1,0][u][0,x] == x Exp[-x^2/2], u[t,-5] == u[t,15]}; we // TeX solwe = NDSolve[we, u, {t,0,10}, {x,-5,10}] Plot3D[u[t,x]/.solwe, {t,0,10}, {x,-5,15}, PlotRange->{-0.1,1.1}] Plot[u[7, x]/.solwe, {x, -5, 15}, PlotRange->{0,1}] plotswe = Table[Plot[u[t, x]/.solwe, {x, -5, 15}, PlotRange->{0,1}], {t, 0, 10, 0.4}]; Export["wave eq.gif", plotswe, "AnimationRepetitions" -> Infinity] pdfnormal[s_, x_] := Exp[-x^2/2*s^2]/Sqrt[2*Pi*s^2] he = {D[u[t,x],t] == D[u[t,x],x,x], u[0,x] == pdfnormal[1/2, x+5] + pdfnormal[2/5, x-5], u[t,-30] == u[t,30]}; he // TeX solhe = NDSolve[he, u, {t,0,20}, {x,-30,30}] Table[Plot[u[t, x]/.solhe, {x, -15, 15}, PlotRange->{-0.1,1}], {t, 0, 20, 4}] plotshe = Table[Plot[u[t, x]/.solhe, {x, -15, 15}, PlotRange->{-0.1,1}], {t, 0, 20, 0.2}]; Export["heat eq.gif", plotshe, "AnimationRepetitions" -> Infinity] kdv = {D[u[t,x],t] == -D[u[t,x],x,x,x]-6 u[t,x] D[u[t,x], x], u[0,x] == -5 Sin[Pi x/10], u[t,-10] == u[t,10]}; kdv // TeX solkdv = NDSolveValue[kdv, u, {t,0,1}, {x,-10,10}, MaxStepSize->0.01] Plot3D[solkdv[t,x], {t,0,0.3}, {x,-10,10}, PlotRange->{-7,15}] Plot[solkdv[0.15, x], {x, -10, 10}, PlotRange->{-5,15}] plotskdv = Table[Plot[solkdv[t, x], {x, -10, 10}, PlotRange->{-7,15}], {t, 0, 1, 0.01}]; Export["KdV sine.gif", plotskdv, "AnimationRepetitions" -> Infinity] ??Style x^2+y^2 Style[x^2+y^2,20] Style[x^2+y^2,40] Style[x^2+y^2,60] L = {{1,2,3}, {2,3,1}, {3,1,2}, {2,2}}; L // TeXEq SortBy[L, First] // TeXEq SortBy[L, Last] // TeXEq SortBy[L, Total] // TeXEq A = {{0,1}, {-p^2,0}}; A // TeXEq MatrixPower[A, 2] // TeX[HoldForm[A^2], "=", #]& MatrixPower[MatrixPower[A, 2],k] // TeX[HoldForm[A^(2k)], "=", #]& MatrixPower[MatrixPower[A, 2],k] . A // TeX[HoldForm[A^(2k+1)], "=", #]& a = ExampleData[{"Audio", "Piano"}]; PitchRecognize[a, AllowedFrequencyRange->{Quantity[200, "Hertz"], Quantity[400, "Hertz"]}] // ListLinePlot ComplexPlot[(z^2+1)/(z^2-1), {z, -2-2 I, 2+ 2I}, ColorFunction->"CyclicLogAbsArg"] ??Zeta (* The first nontrivial zero of the Riemann zeta *) ComplexPlot[Zeta[s], {s, 13.7 I, 1+14.7 I}, ColorFunction->"CyclicLogAbsArg"] data = Table[a t Exp[2 Pi I t], {a,2,4}, {t,0,1,0.02}]; ComplexListPlot[data, PlotLegends->{"a=2", "a=3", "a=4"}] zetadata = Table[Zeta[0.6+t I], {t, 0, 100, 0.01}]; ComplexListPlot[zetadata] Graphics3D[Dodecahedron[]] Graphics3D[AugmentedPolyhedron[Dodecahedron[]]] ComplexListPlot[Eigenvalues[RandomVariate[NormalDistribution[], {1000, 1000}]/Sqrt[1000]]] A = {{2,-1},{-1,2}}; A // TeXEq ev = Eigensystem[A]; evals = ev[[1]]; evals // TeX["eigen values: ",#]& evecs = ev[[2]]; Map[MatrixForm, evecs] // TeX["eigen vectors: ",#]& A = {{2,-1,0},{-1,2,-1},{0,-1,2}}; A // TeXEq ev = Eigensystem[A]; evals = ev[[1]]; evals // TeX["eigen values: ",#]& evecs = ev[[2]]; Map[MatrixForm, evecs] // TeX["eigen vectors: ",#]& A = {{2,-1,0,0},{-1,2,-1,0},{0,-1,2,-1},{0,0,-1,2}}; A // TeXEq ev = Eigensystem[A]; evals = ev[[1]]; evals // TeX["eigen values: ",#]& evecs = ev[[2]]; Map[MatrixForm, evecs] // TeX["eigen vectors: ",#]& A = {{2,-1,0,0,0},{-1,2,-1,0,0},{0,-1,2,-1,0},{0,0,-1,2,-1},{0,0,0,-1,2}}; A // TeXEq ev = Eigensystem[A]; evals = ev[[1]]; evals // TeX["eigen values: ",#]& evecs = ev[[2]]; Map[MatrixForm, evecs] // TeX["eigen vectors: ",#]& A = { {2, -1, 0, 0, 0, 0}, {-1, 2, -1, 0, 0, 0}, {0, -1, 2, -1, 0, 0}, {0, 0, -1, 2, -1, 0}, {0, 0, 0, -1, 2, -1}, {0, 0, 0, 0, -1, 2} }; A // TeXEq ev = Eigensystem[A]; evals = ev[[1]]; N[evals] // TeX["eigen values: ",#]& evecs = ev[[2]]; Map[MatrixForm, N[evecs]] // TeX["eigen vectors: ",#]& A = {{27, 48, 81}, {-6, 0, 0}, {1, 0, 3}}; A // TeXEq Factor[CharacteristicPolynomial[A, x]] // TeX["characteristic polynomial: ", #]& SJ = JordanDecomposition[A]; S = SJ[[1]]; J = SJ[[2]]; S // TeXEq J // TeXEq S . J . Inverse[S] // TeXEq ??MandelbrotSetPlot MandelbrotSetPlot[] MandelbrotSetPlot[{-0.52-0.62 I, -0.50-0.60 I}] ??JuliaSetPlot JuliaSetPlot[0.365 - 0.37 I, PlotLegends -> Automatic, PlotRange->{{-1.2, 1.2}, {-1.5, 1.5}}] JuliaSetPlot[0.30 - 0.37 I, PlotLegends -> Automatic, PlotRange->{{-1.2, 1.2}, {-1.5, 1.5}}] JuliaSetPlot[0.4 - 0.37 I, PlotLegends -> Automatic, PlotRange->{{-1.2, 1.2}, {-1.5, 1.5}}] juliasets = Table[JuliaSetPlot[0.345 + 0.01 t + 0.04 t Abs[t] - 0.37 I, PlotRange->{{-1.2, 1.2}, {-1.5, 1.5}}], {t, -1, 1.5, 0.02}]; Export["JuliaSets.gif", juliasets, "AnimationRepetitions" -> Infinity] ??Integrate Integrate[Log[Sin[x]], x] // TeXEq Integrate[Log[Sin[x]], {x, 0, Pi/2}] // TeXEq Integrate[Log[x]/(1+x^2), x] // TeXEq Integrate[Log[x]/(1+x^2), {x,0,Infinity}] // TeXEq Integrate[Log[x]/(1+x^2), {x,1,Infinity}] // TeXEq Catalan // TeX[#, "=", "Catalan number"]& ??Catalan ??FourierSeries ??FourierTrigSeries B[n_, x_] := BernoulliB[n, x] F[n_, x_, N_] := FourierTrigSeries[B[n,x] /. x -> x/(2 Pi) + 1/2, x, N] /. x->2 Pi x - Pi BB = B[1,x]; BB // TeXRaw["B_1(x)=", #]& FF = F[1,x,10]; FF // TeX["Fourier series = ", #]& Plot[{BB, FF}, {x,-0.1,1.1}] BB = B[2,x]; BB // TeXRaw["B_1(x)=", #]& FF = F[2,x,10]; FF // TeX["Fourier series = ", #]& Plot[{BB, FF}, {x,-0.1,1.1}] ??Series FF = (1+x*h)^(1/h); FF // TeXRaw["f(h)=",#]& SS = Series[FF, {h, 0, 3}]; SS // TeXRaw["f(h)=",#]& NN = Normal[SS]; NN // TeXRaw["f(h)\approx",#]& Plot[{FF/.x->1, NN/.x->1}, {h,-1,2}] ??PolyGamma FF = PolyGamma[x]; SS = Series[FF, {x,0,2}]; SS // TeX[FF,"=",#]& NN = Normal[SS]; NN // StringJoin[TeX[FF], "\approx", TeX[#]]& Plot[{FF, NN}, {x, 0, 1.5}] FF = PolyGamma[x]; SS = Series[FF, {x,Infinity,2}]; SS // TeX[FF, "=", #]& NN = Normal[SS]; NN // StringJoin[TeX[FF], "\approx", TeX[#]]& Plot[{FF, NN}, {x, 0, 1.5}] qnum[x_, h_] := (E^(h x)-1)/(E^h-1); qnum[x,h] // TeXRaw["(x)_h=", #]& SS = Series[E^h qnum[x,h], {h,0,7}]; SS // TeXRaw["(x)_h=", #]& sumsofpowers = Table[Factor[k! SeriesCoefficient[SS, k]]/.x->n, {k,1,7}]; sumsofpowers // TeX["sums of powers: ", #]&