Skip to content

calculus -- bugs in solve #3745

@williamstein

Description

@williamstein

We get a "solution" from solve() that isn't actually a solution:

sage: f(x) = (sin(x) - 8*cos(x)*sin(x))*(sin(x)^2 + cos(x)) - (2*cos(x)*sin(x) - sin(x))*(-2*sin(x)^2 + 2*cos(x)^2 - cos(x))
sage: solve(f(x), x)
[x == pi, x == 1/2*pi, x == 0]
sage: f(pi/2)
-1

The following is correct:

sage: solve(f(x).simplify_trig(), x)
[x == 0, x == pi - arccos(1/3), x == pi]

Reduced example (after manually removing the factor sin(x)):

sage: g(x) = (1 - 8*cos(x))*(sin(x)^2 + cos(x)) - (2*cos(x) - 1)*(-2*sin(x)^2 + 2*cos(x)^2 - cos(x))
sage: solve(g(x), x)
[x == pi, x == 1/2*pi]
sage: g(pi/2)
-1

Upstream: Reported upstream. No feedback yet.

Component: calculus

Stopgaps: todo

Issue created by migration from https://trac.sagemath.org/ticket/3745

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions