Clear[f,ff,fun,x,nfunct,e,sin,cos,arctan,arcsin,ln,a,info,month,day,year,t1,t2,t3,a,ay,bee,funlist];
ay=RandomInteger[{1,7}];
bee=RandomInteger[{1,9}];
f[1,x_]=(Sqrt[x]);
f[2,x_]=(1/x);
f[3,x_]=(x^bee);
f[4,x_]=(e^x);
f[5,x_]=(ay^x);
f[6,x_]=sin[x];
f[7,x_]=cos[x];
a[1,x_]=arcsin[x];
a[2,x_]=arctan[x];
f[8,x_]=a[RandomInteger[{1,2}],x];
f[9,x_]=ln[x];
nfunct=9;
funlist={0,0,0,0,0,0,0,0,0};
Do[newlist=Complement[{1,2,3,4,5,6,7,8,9},funlist];(funlist[[i]]=newlist[[RandomInteger[{1,Length[newlist]}]]];),{i,1,9}];
Clear[fun,x];
Do[fun[i,x_]=f[funlist[[i]],x],{i,1,9}];
Clear[ff,x];
ff[1,x_]=fun[1,x];
ff[2,x_]=fun[3,x];
ff[3,x_]=RandomInteger[{2,9}] fun[5,x]+RandomInteger[{-6,-1}] fun[9,x];
ff[4,x_]=fun[7,fun[8,x]];
ff[5,x_]=fun[9,fun[2,x]];
ff[6,x_]=fun[6,x] fun[4,x];

ff[7,x_]=((fun[3,x])/(fun[5,x]));
ff[8,x_]=(1/2) RandomInteger[{-4,4}] fun[7,x]+RandomInteger[{-9,9}] fun[9,x];ff[9,x_]=fun[8,fun[1,fun[6,x]]];month=DateList[][[2]];day=DateList[][[3]];year=DateList[][[1]]-2000;t1=DateList[][[4]];t2=DateList[][[5]];t3=DateList[][[6]];Print[" "];Print["Calc.II Gateway","  (",month,"/",day,"/",year,", ",t1,":",t2,":",t3,")"];Print["Derivatives"];Do[Print[i,".  \!\(\*FractionBox[\(d\), \(dx\)]\)\!\(\*\nStyleBox[\"(\",\nFontSize->24]\)",ff[i,x],"\!\(\*\nStyleBox[\")\",\nFontSize->24]\)"];Print[" "],{i,1,6}];Print[" "];Clear[f,x,n,k,c,cos,sin,ln,arctan,gun,fun,a,b,alist,blist];f[1,x_]:=(e^(k x));f[2,x_]:=cos[x];f[3,x_]:=sin[x];f[4,x_]:=(x^n);f[7,x_]:=ln[x];f[6,x_]:=arctan[x];fun[x_]=RandomInteger[9] (x^3)-RandomInteger[9] x+RandomInteger[9];f[5,x_]=fun[x];Clear[g,x,n,k,c];g[1,x_]:=(e^(k x));g[2,x_]:=sin[x];g[3,x_]:=cos[x];g[4,x_]:=(x^(n-1));g[7,x_]:=(1/x);g[6,x_]:=(1/(1+(x^2)));gun[x_]=(∂_x)fun[x];g[5,x_]=gun[x];Clear[k,n,c,Cee,r,i,choice,list,explist];n=Permutations[{-1,-2,-(1/2),(1/2),3}][[RandomInteger[{1,5!}]]][[1]];k=RandomInteger[{2,9}];c=RandomInteger[{2,9}];Cee=RandomInteger[{2,9}];choice=RandomInteger[7!];list=Permutations[{1,2,3,4,5,6,7}][[choice]];Print["Integration"];Print["7. ","\!\(\*\nStyleBox[\"∫\",\nFontSize->24]\)\!\(\*\nStyleBox[\"(\",\nFontSize->24]\) ",g[list[[1]],x],"\!\(\*\nStyleBox[\")\",\nFontSize->24]\) dx"];Print["8. ","\!\(\*\nStyleBox[\"∫\",\nFontSize->24]\)\!\(\*\nStyleBox[\"(\",\nFontSize->24]\) ",Cee g[list[[2]],x],"\!\(\*\nStyleBox[\")\",\nFontSize->24]\) dx"];Print["9. ","\!\(\*\nStyleBox[\"∫\",\nFontSize->24]\)\!\(\*\nStyleBox[\"(\",\nFontSize->24]\)",g[list[[4]],x]+g[list[[5]],x],"\!\(\*\nStyleBox[\")\",\nFontSize->24]\) dx"];Print["10. ","\!\(\*\nStyleBox[\"∫\",\nFontSize->24]\)\!\(\*\nStyleBox[\"(\",\nFontSize->24]\) ",Expand[g[list[[3]],k x]],"\!\(\*\nStyleBox[\")\",\nFontSize->24]\) dx"];

©Tamara Olson