Repository navigation
Commit 1c5fb82
authored
Put a difference of two divergent fractions over one denominator (#699)
* Put a difference of two divergent fractions over one denominator
Nothing in the descent takes a difference apart any further than asking what
each half tends to, so 1/x - 1/sin(x) at 0 came out as +oo - +oo on the right
and -oo - -oo on the left, and NaN either way -- the claim that the limit does
not exist, where it is 0. Written over the common denominator the same
expression is (sin(x) - x) / (x * sin(x)), an ordinary 0/0 that l'Hopital's rule
settles in three steps.
The rewrite goes where the products already went. AsQuotient existed to hand the
rule the quotients that are not written as one, and a sum of fractions is the
second kind of those; it is now the one place that answers what the numerator
and the denominator of an expression are, for a product and for a sum of them
alike.
Only where a denominator contains the variable, since it is the denominators
that vanish or diverge that make the difference indeterminate, and combining
over a constant gains nothing while still costing the rule an expression to
differentiate. Only up to three terms: each one multiplies the numerator by
every other term's denominator, so the expression grows with the square of the
count, and two or three is what the forms that need this are written with.
Answers 1/x - 1/sin(x) and 1/sin(x) - 1/x at 0, csc(x) - cotan(x) at 0, and
1/ln(x) - 1/(x - 1) at 1 either way round. Five of the eleven new tests fail
without it. Corpus unchanged at 101/117 with 0 wrong; suite 4020 passed,
0 failed.
* Write a tangent as a quotient before combining the fractions
tan(x) is opaque to everything that reads quotients: it is neither a quotient
nor a negative power, so the split puts it into the numerator whole and
1/x - 1/tan(x) comes out over x * tan(x). That is the right answer written in
the wrong form. The rules do reach 0 through it, but only after rewriting the
whole expression dozens of ways, and lim x->0+ (1/sin(x) - 1/tan(x)) took forty
seconds against under one for the same limit over sin(x) * sin(x).
Not with the other trigonometric rewrite, which runs in front of the first
remarkable limit. That one matches a quotient, and rewriting tan(b*x - x) as a
quotient of its own turns the quotient it sits under into a product:
lim x->0 sin(x - a*x) / tan(b*x - x), which the suite pins at (a-1)/(1-b),
stops being read at all. Measured, not reasoned about -- it is what the test
caught when the rewrite was put there first.
Suite 4020 passed, 0 failed, unchanged.1 parent a2cc479 commit 1c5fb82
3 files changed
Lines changed: 144 additions & 14 deletions
File tree
- Sources
- AngouriMath/Functions/Continuous/Limits
- Solvers
- Tests/UnitTests/Calculus
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
63 | 77 | | |
64 | 78 | | |
65 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
204 | 202 | | |
205 | | - | |
| 203 | + | |
206 | 204 | | |
207 | | - | |
208 | | - | |
209 | 205 | | |
210 | | - | |
211 | 206 | | |
212 | 207 | | |
213 | 208 | | |
214 | 209 | | |
215 | 210 | | |
216 | | - | |
217 | 211 | | |
218 | 212 | | |
219 | 213 | | |
220 | | - | |
221 | 214 | | |
222 | 215 | | |
223 | 216 | | |
224 | 217 | | |
225 | | - | |
226 | 218 | | |
227 | 219 | | |
228 | 220 | | |
229 | 221 | | |
230 | 222 | | |
231 | | - | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
232 | 278 | | |
233 | 279 | | |
234 | 280 | | |
| |||
258 | 304 | | |
259 | 305 | | |
260 | 306 | | |
261 | | - | |
| 307 | + | |
262 | 308 | | |
263 | 309 | | |
264 | 310 | | |
| |||
490 | 536 | | |
491 | 537 | | |
492 | 538 | | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
493 | 553 | | |
494 | 554 | | |
495 | 555 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
0 commit comments