LIMITS.LOG 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833
  1. REDUCE 3.6, 15-Jul-95, patched to 6 Mar 96 ...
  2. % Tests of limits package.
  3. limit(sin(x)/x,x,0);
  4. 1
  5. % 1
  6. limit(sin(x)^2/x,x,0);
  7. 0
  8. % 0
  9. limit(sin(x)/x,x,1);
  10. sin(1)
  11. % sin(1)
  12. limit(1/x,x,0);
  13. infinity
  14. % infinity
  15. limit(-1/x,x,0);
  16. - infinity
  17. % - infinity
  18. limit((sin(x)-x)/x^3,x,0);
  19. - 1
  20. ------
  21. 6
  22. % -1/6
  23. limit(x*sin(1/x),x,infinity);
  24. 1
  25. % 1
  26. limit(sin x/x^2,x,0);
  27. infinity
  28. % infinity
  29. limit(x^2*sin(1/x),x,infinity);
  30. infinity
  31. % infinity
  32. % Simple examples from Schaum's Theory & Problems of Advanced Calculus
  33. limit(x^2-6x+4,x,2);
  34. -4
  35. % -4
  36. limit((x+3)*(2x-1)/(x^2+3x-2),x,-1);
  37. 3
  38. ---
  39. 2
  40. % 3/2
  41. limit((sqrt(4+h)-2)/h,h,0);
  42. 1
  43. ---
  44. 4
  45. % 1/4
  46. limit((sqrt(x)-2)/(4-x),x,4);
  47. - 1
  48. ------
  49. 4
  50. % -1/4
  51. limit((x^2-4)/(x-2),x,2);
  52. 4
  53. % 4
  54. limit(1/(2x-5),x,-1);
  55. - 1
  56. ------
  57. 7
  58. % -1/7
  59. limit(sqrt(x)/(x+1),x,1);
  60. 1
  61. ---
  62. 2
  63. % 1/2
  64. limit((2x+5)/(3x-2),x,infinity);
  65. 2
  66. ---
  67. 3
  68. % 2/3
  69. limit((1/(x+3)-2/(3x+5))/(x-1),x,1);
  70. 1
  71. ----
  72. 32
  73. % 1/32
  74. limit(sin(3x)/x,x,0);
  75. 3
  76. % 3
  77. limit((1-cos(x))/x^2,x,0);
  78. 1
  79. ---
  80. 2
  81. % 1/2
  82. limit((6x-sin(2x))/(2x+3*sin(4x)),x,0);
  83. 2
  84. ---
  85. 7
  86. % 2/7
  87. limit((1-2*cos(x)+cos(2x))/x^2,x,0);
  88. -1
  89. % -1
  90. limit((3*sin(pi*x) - sin(3*pi*x))/x^3,x,0);
  91. 3
  92. 4*pi
  93. % 4*pi^3
  94. limit((cos(a*x)-cos(b*x))/x^2,x,0);
  95. 2 2
  96. - a + b
  97. ------------
  98. 2
  99. % (-a^2 + b^2)/2
  100. limit((e^x-1)/x,x,0);
  101. 1
  102. % 1
  103. limit((a^x-b^x)/x,x,0);
  104. log(a) - log(b)
  105. % log(a) - log(b)
  106. % Examples taken from Hyslop's Real Variable
  107. limit(sinh(2x)^2/log(1+x^2),x,0);
  108. 4
  109. % 4
  110. limit(x^2*(e^(1/x)-1)*(log(x+2)-log(x)),x,infinity);
  111. 2
  112. % 2
  113. limit(x^alpha*log(x+1)^2/log(x),x,infinity);
  114. 2
  115. alpha log(x + 1)
  116. limit(x *-------------,x,infinity)
  117. log(x)
  118. %% if repart alpha < 0 then 0 else infinity.
  119. %% fails because answer depends in essential way on parameter.
  120. limit((2*cosh(x)-2-x^2)/log(1+x^2)^2,x,0);
  121. 1
  122. ----
  123. 12
  124. % 1/12
  125. limit((x*sinh(x)-2+2*cosh(x))/(x^4+2*x^2),x,0);
  126. 1
  127. % 1
  128. limit((2*sinh(x)-tanh(x))/(e^x-1),x,0);
  129. 1
  130. % 1
  131. limit(x*tanh(x)/(sqrt(1-x^2)-1),x,0);
  132. -2
  133. % -2
  134. limit((2*log(1+x)+x^2-2*x)/x^3,x,0);
  135. 2
  136. ---
  137. 3
  138. % 2/3
  139. limit((e^(5*x)-2*x)^(1/x),x,0);
  140. 3
  141. e
  142. % e^3
  143. limit(log(log(x))/log(x)^2,x,infinity);
  144. 0
  145. % 0
  146. % These are adapted from Lession 4 from Stoutmyer
  147. limit((e^x-1)/x, x, 0);
  148. 1
  149. % 1
  150. limit(((1-x)/log(x))**2, x, 1);
  151. 1
  152. % 1
  153. limit(x/(e**x-1), x, 0);
  154. 1
  155. % 1
  156. %% One sided limits
  157. limit!+(sin(x)/sqrt(x),x,0);
  158. 0
  159. % 0
  160. limit!-(sin(x)/sqrt(x),x,0);
  161. 0
  162. % 0
  163. limit(x/log x,x,0);
  164. 0
  165. % 0
  166. limit(log(1 + x)/log x,x,infinity);
  167. 1
  168. % 1
  169. limit(log x/sqrt x,x,infinity);
  170. 0
  171. % 0
  172. limit!+(sqrt x/sin x,x,0);
  173. infinity
  174. % infinity
  175. limit(log x,x,0);
  176. - infinity
  177. % - infinity
  178. limit(x*log x,x,0);
  179. 0
  180. % 0
  181. limit(log x/log(2x),x,0);
  182. 1
  183. % 1
  184. limit(log x*log(1+x)*(1+x),x,0);
  185. 0
  186. % 0
  187. limit(log x/x,x,infinity);
  188. 0
  189. % 0
  190. limit(log x/sqrt x,x,infinity);
  191. 0
  192. % 0
  193. limit(log x,x,infinity);
  194. infinity
  195. % infinity
  196. limit(log(x+1)/sin x,x,0);
  197. 1
  198. % 1
  199. limit(log(1+1/x)*sin x,x,0);
  200. 0
  201. % 0
  202. limit(-log(1+x)*(x+2)/sin x,x,0);
  203. -2
  204. % -2
  205. limit(-log x*(3+x)/log(2x),x,0);
  206. -3
  207. % -3
  208. limit(log(x+1)^2/sqrt x,x,infinity);
  209. 0
  210. % 0
  211. limit(log(x + 1) - log x,x,infinity);
  212. 0
  213. % 0
  214. limit(-(log x)^2/log log x,x,infinity);
  215. - infinity
  216. % - infinity
  217. limit(log(x-1)/sin x,x,0);
  218. sign(log(-1))*infinity
  219. % infinity
  220. limit!-(sqrt x/sin x,x,0);
  221. - sign(i)*infinity
  222. % infinity
  223. limit(log x-log(2x),x,0);
  224. - log(2)
  225. % - log(2)
  226. limit(sqrt x-sqrt(x+1),x,infinity);
  227. 0
  228. % 0
  229. limit(sin sin x/x,x,0);
  230. 1
  231. % 1
  232. limit!-(sin x/cos x,x,pi/2);
  233. infinity
  234. % infinity % this works!
  235. limit!+(sin x/cos x,x,pi/2);
  236. - infinity
  237. % - infinity % so does this!
  238. limit(sin x/cosh x,x,infinity);
  239. 0
  240. % 0
  241. limit(sin x/x,x,infinity);
  242. 0
  243. % 0
  244. limit(x*sin(1/x),x,0);
  245. 0
  246. % 0
  247. limit(exp x/((exp x + exp(-x))/2),x,infinity);
  248. 2
  249. % 2
  250. % limit(exp x/cosh x,x,infinity); % fails in this form, but if cosh is
  251. %defined using let, then it works.
  252. limit((sin(x^2)/(x*sinh x)),x,0);
  253. 1
  254. % 1
  255. limit(log x*sin(x^2)/(x*sinh x),x,0);
  256. - infinity
  257. % - infinity
  258. limit(sin(x^2)/(x*sinh x*log x),x,0);
  259. 0
  260. % 0
  261. limit(log x/log(x^2),x,0);
  262. 1
  263. ---
  264. 2
  265. % 1/2
  266. limit(log(x^2)-log(x^2+8x),x,0);
  267. - infinity
  268. % - infinity
  269. limit(log(x^2)-log(x^2+8x),x,infinity);
  270. 0
  271. % 0
  272. limit(sqrt(x+5)-sqrt x,x,infinity);
  273. 0
  274. % 0
  275. limit(2^(log x),x,0);
  276. 0
  277. % 0
  278. % Additional examples
  279. limit((sin tan x-tan sin x)/(asin atan x-atan asin x),x,0);
  280. 1
  281. % 1
  282. % This one has the value infinity, but fails with de L'Hospital's rule:
  283. limit((e+1)^(x^2)/e^x,x,infinity);
  284. 2
  285. x
  286. (e + 1)
  287. limit(-----------,x,infinity)
  288. x
  289. e
  290. % infinity % fails
  291. comment
  292. The following examples were not in the previous set$
  293. % Simon test examples:
  294. limit(log(x-a)/((a-b)*(a-c)) + log(2(x-b))/((b-c)*(b-a))
  295. + log(x-c)/((c-a)*(c-b)),x,infinity);
  296. 1
  297. log(---)
  298. 2
  299. ----------------------
  300. 2
  301. a*b - a*c - b + b*c
  302. % log(1/2)/((a-b)*(b-c))
  303. limit(1/(e^x-e^(x-1/x^2)),x,infinity);
  304. 1
  305. limit(----------------,x,infinity)
  306. 2
  307. x x - 1/x
  308. e - e
  309. % infinity % fails
  310. % new capabilities: branch points at the origin, needed for definite
  311. % integration.
  312. limit(x+sqrt x,x,0);
  313. 0
  314. % 0
  315. limit!+(sqrt x/(x+1),x,0);
  316. 0
  317. % 0
  318. limit!+(x^(1/3)/(x+1),x,0);
  319. 0
  320. % 0
  321. limit(log(x)^2/x^(1/3),x,0);
  322. infinity
  323. % infinity
  324. limit(log x/x^(1/3),x,0);
  325. - infinity
  326. % - infinity
  327. h := (X^(1/3) + 3*X**(1/4))/(7*(SQRT(X + 9) - 3)**(1/4));
  328. 1/4 1/3
  329. 3*x + x
  330. h := ------------------------
  331. 1/4
  332. 7*(sqrt(x + 9) - 3)
  333. limit(h,x,0);
  334. 1/4
  335. 3*6
  336. --------
  337. 7
  338. % 3/7*6^(1/4)
  339. % Examples from Paul S. Wang's thesis:
  340. limit(x^log(1/x),x,infinity);
  341. 0
  342. % 0
  343. limit(cos x - 1/(e^x^2 - 1),x,0);
  344. - infinity
  345. % - infinity
  346. limit((1+a*x)^(1/x),x,infinity);
  347. 1
  348. % 1
  349. limit(x^2*sqrt(4*x^4+5)-2*x^4,x,infinity);
  350. 5
  351. ---
  352. 4
  353. % 5/4
  354. limit!+(1/x-1/sin x,x,0);
  355. 0
  356. % 0
  357. limit(e^(x*sqrt(x^2+1))-e^(x^2),x,infinity);
  358. 2 2
  359. x*sqrt(x + 1) x
  360. limit(e - e ,x,infinity)
  361. % 0 fails
  362. limit((e^x+x*log x)/(log(x^4+x+1)+e^sqrt(x^3+1)),x,infinity);
  363. x
  364. e + x*log(x)
  365. limit(---------------------------------,x,infinity)
  366. 3
  367. 4 sqrt(x + 1)
  368. log(x + x + 1) + e
  369. %0 % fails
  370. limit!-(1/(x^3-6*x+11*x-6),x,2);
  371. 1
  372. ----
  373. 12
  374. % 1/12
  375. limit((x*sqrt(x+5))/(sqrt(4*x^3+1)+x),x,infinity);
  376. 1
  377. ---
  378. 2
  379. % 1/2
  380. limit!-(tan x/log cos x,x,pi/2);
  381. - infinity
  382. % - infinity
  383. z0 := z*(z-2*pi*i)*(z-pi*i/2)/(sinh z - i);
  384. 2 2
  385. z*( - 5*i*pi*z - 2*pi + 2*z )
  386. z0 := --------------------------------
  387. 2*(sinh(z) - i)
  388. limit(df(z0,z),z,pi*i/2);
  389. sign(i)*infinity
  390. % infinity
  391. z1 := z0*(z-pi*i/2);
  392. 3 2 2 3
  393. z*(2*i*pi - 12*i*pi*z - 9*pi *z + 4*z )
  394. z1 := -------------------------------------------
  395. 4*(sinh(z) - i)
  396. limit(df(z1,z),z,pi*i/2);
  397. - 2*pi
  398. % -2*pi
  399. % and the analogous problem:
  400. z2 := z*(z-2*pi)*(z-pi/2)/(sin z - 1);
  401. 2 2
  402. z*(2*pi - 5*pi*z + 2*z )
  403. z2 := ---------------------------
  404. 2*(sin(z) - 1)
  405. limit(df(z2,z),z,pi/2);
  406. - infinity
  407. % infinity
  408. z3 := z2*(z-pi/2);
  409. 3 2 2 3
  410. z*( - 2*pi + 9*pi *z - 12*pi*z + 4*z )
  411. z3 := ------------------------------------------
  412. 4*(sin(z) - 1)
  413. limit(df(z3,z),z,pi/2);
  414. 2*pi
  415. % 2*pi
  416. % A test by Wolfram Koepf.
  417. f:=x^2/(3*(-27*x^2 - 2*x^3 + 3^(3/2)*(27*x^4 + 4*x^5)^(1/2))^(1/3));
  418. 2
  419. x
  420. f := --------------------------------------------------------
  421. 2 3 2 1/3
  422. 3*(3*sqrt(4*x + 27)*sqrt(3)*abs(x) - 2*x - 27*x )
  423. L0:=limit(f,x,0);
  424. l0 := 0
  425. % L0 := 0
  426. f1:=((f-L0)/x^(1/3))$
  427. L1:=limit(f1,x,0);
  428. l1 := 0
  429. % L1 := 0
  430. f2:=((f1-L1)/x^(1/3))$
  431. L2:=limit(f2,x,0);
  432. - 1
  433. l2 := ------
  434. 1/3
  435. 2
  436. % L2 := -1/2^(1/3)
  437. f3:=((f2-L2)/x^(1/3))$
  438. L3:=limit(f3,x,0);
  439. l3 := 0
  440. % L3 := 0
  441. f4:=((f3-L3)/x^(1/3))$
  442. L4:=limit(f4,x,0);
  443. l4 := 0
  444. % L4 := 0
  445. f5:=((f4-L4)/x^(1/3))$
  446. L5:=limit(f5,x,0);
  447. 2/3
  448. - 2
  449. l5 := ---------
  450. 81
  451. % L5 = -2^(2/3)/81
  452. f6:=((f5-L5)/x^(1/3))$
  453. L6:=limit(f6,x,0);
  454. l6 := 0
  455. % L6 := 0
  456. f7:=((f6-L6)/x^(1/3))$
  457. L7:=limit(f7,x,0);
  458. l7 := 0
  459. % L7 := 0
  460. f8:=((f7-L7)/x^(1/3))$
  461. L8:=limit(f8,x,0);
  462. 7
  463. l8 := -----------
  464. 1/3
  465. 6561*2
  466. % L8 := 7/(6561*2^(1/3))
  467. limit(log(1+x)^2/x^(1/3),x,infinity);
  468. 0
  469. % 0
  470. limit(e^(log(1+x)^2/x^(1/3)),x,infinity);
  471. 1
  472. % 1
  473. ss := (sqrt(x^(2/5) +1) - x^(1/3)-1)/x^(1/3);
  474. 2/5 1/3
  475. sqrt(x + 1) - x - 1
  476. ss := ---------------------------
  477. 1/3
  478. x
  479. limit(ss,x,0);
  480. -1
  481. % -1
  482. limit(exp(ss),x,0);
  483. 1
  484. ---
  485. e
  486. % 1/e
  487. limit(log x,x,-1);
  488. log(-1)
  489. % log(-1)
  490. limit(log(ss),x,0);
  491. log(-1)
  492. % log(-1)
  493. ss := ((x^(1/2) - 1)^(1/3) + (x^(1/5) + 1)^2)/x^(1/5);
  494. 1/3 2/5 1/5
  495. (sqrt(x) - 1) + x + 2*x + 1
  496. ss := --------------------------------------
  497. 1/5
  498. x
  499. limit(ss,x,0);
  500. 2
  501. % 2
  502. h := (X^(1/5) + 3*X**(1/4))^2/(7*(SQRT(X + 9) - 3 - x/6))**(1/5);
  503. 1/5 2/5 9/20
  504. 6 *(x + 6*x + 9*sqrt(x))
  505. h := -----------------------------------
  506. 1/5 1/5
  507. (6*sqrt(x + 9) - x - 18) *7
  508. limit(h,x,0);
  509. 3/5
  510. - 6
  511. ---------
  512. 1/5
  513. 7
  514. % -6^(3/5)/7^(1/5)
  515. end;
  516. (TIME: limits 28710 30110)