| 438 | describe('reverse chain rule — DerivativeDivides (4.7.5 #64–#67)', () => { |
| 439 | // Rules pass ActivateTrig[y]/ActivateTrig[u]; pass active heads directly. |
| 440 | const dd = (y: Json, u: Json): Expression => |
| 441 | build(['DerivativeDivides', y, u, 'x'] as Json, ctx); |
| 442 | |
| 443 | test('D(sin)=cos divides cos → 1 (∫cos·sin^m)', () => { |
| 444 | expect(dd(['Sin', 'x'], ['Cos', 'x']).isSame(1)).toBe(true); |
| 445 | }); |
| 446 | |
| 447 | test('D(tan)=sec² divides sec² → 1 (∫sec²·tan^m)', () => { |
| 448 | expect(dd(['Tan', 'x'], ['Power', ['Sec', 'x'], 2]).isSame(1)).toBe(true); |
| 449 | }); |
| 450 | |
| 451 | test('the wrong AC split returns the False symbol (not RuleFail)', () => { |
| 452 | // y=cos, u=sin⁴: u/D(cos) = sin⁴/(−sin) = −sin³, not free of x |
| 453 | expect(dd(['Cos', 'x'], ['Power', ['Sin', 'x'], 4]).symbol).toBe('False'); |
| 454 | }); |
| 455 | |
| 456 | test('a bare linear y (a·x) is declined → False', () => { |
| 457 | expect(dd(['Multiply', 2, 'x'], ['Cos', 'x']).symbol).toBe('False'); |