The tag has no usage guidance.

learn more… | top users | synonyms

27
votes
3answers
1k views

Common subexpression from two expressions

I am working with some unpleasantly tedious polynomials, which need to be manipulated in various ways (integrate with respect to some variable, differentiate with respect to another). Since these ...
12
votes
4answers
9k views

Factoring polynomials to factors involving complex coefficients

I've run into some problems using Factor on polynomials with complex coefficient factors. Reading the documentation it looks like it only factors over the ...
9
votes
0answers
701 views

Does Mathematica use the Elliptic Curve Method (ECM) in FactorInteger[]?

I'm not a mathematician, and I'm not even going to pretend that I understand anything of the ECM. But I know it can be a fast method for factorization. I benchmarked the factorization of $$...
8
votes
2answers
140 views

Collect/Factor a fraction

Is there a way to tell Mathematica to factor things only containing a specific combination of a fraction, example: $$\tag{1}f = \frac{a+m\cdot a+b+n\cdot b+c+k\cdot c+d+e}{ab}$$ Is there a way to ...
7
votes
3answers
490 views

Better answer to Santa's riddle about sum of a number's divisors?

I was hoping to find an elegant solution to this riddle, using only a line or two of Mathematica: Santa Claus was telling one of his elves: "If I multiply the age of three of my reindeer, I get ...
6
votes
6answers
392 views

Rewrite a real polynomial in real (but only linear and quadratic) factors

According to my calculus book: "Every real polynomial can be factored into a product of real (possibly repeated) linear factors and real (also possibly repeated) quadratic factors having no real zeros....
5
votes
2answers
309 views

How can I make the output from Solve look nice?

I have a problem with presenting solutions. Roots of 4th order polynomials are big expressions. Is there a way to present the roots, s2 and s3, in normal form with some substitutions? Maybe a way to ...
5
votes
2answers
190 views

FactorInteger over UFDs

How can I factor 'integers' over other quadratic number fields (not just gaussian integers). For instance, how could I factor $7 = (3 + ω)(2 − ω)$ over Eisenstein integers ($ω = \frac{-1+ I \sqrt{3}}{...
5
votes
1answer
520 views

Time approximation of decrypting RSA algorithm

I've written a function that encrypts a text using the RSA algorithm. It then decrypts it using prime factorization, and takes the time it took to decrypt it and puts it in a vector together with the ...
4
votes
3answers
458 views

Specific factoring of fourth degree polynomial

I have a pretty unspecific question about a really specific thing -- How would one use Mathematica to find values for an integer, m, such that this polynomial ...
4
votes
1answer
365 views

Factoring a two variable polynomial in a special way

Let $$f=x^9-x^6+4x^5y+2x^3y^2-y^4$$ I would like to factorize $f$ into form: $$(y-F_1(x))\cdots(y-F_k(x))$$ over complex numbers. How can I do it with Mathematica?
4
votes
1answer
299 views

Generating a list of all factorizations

What is the best way to generate a list of all factorizations of some number $n$? I'm quite new to Mathematica so this might be obvious. I have been trying some basic stuff with ...
4
votes
1answer
40 views

Relative factorisation with scalar quantities

I'd like to find a natural way to tell mathematica that a given unknown in a polynomial should be treated as a number, unlike the other variables. Typically I'd like to sum two polynomials in several ...
3
votes
2answers
323 views

Represent a positive integer as a product of its factors

I am trying to illustrate some simple ideas with exponents. I can manually express something like $5^4$ as $5 \cdot 5 \cdot 5 \cdot 5$, but wondered how to get Mathematica to do that for me. I ...
3
votes
2answers
527 views

Find the a factor of an integer which is nearest to another integer

If I know two integers $n$ and $m$ and $m < n$, how can I find two different integers $x$ and $y$ that are nearest to $m$, and satisfy Mod[n,x]==Mod[n,y]==0 ? ...
3
votes
1answer
95 views

Can Mathematica factor a polynomial over an algebraic number field?

If I input: Factor[x^2 + x + 1, Extension -> Sqrt[-3]] Mathematica returns: ...
3
votes
1answer
188 views

Factoring the imaginary unit

Suppose you have this: Collect[2 u + I + 2 + I,I] It gives the same. Is it possible to factor I in elegant way (not manually)...
3
votes
3answers
601 views

Generating pairs of additive and multiplicative factors for integers

Given an integer $n$, I want to get two lists: a) the set of pairs of the divsors $a,b$ into exactly two factors $n=a\cdot b$, b) the set of pairs $a,b$ of two summands $n=a+b$. The code I ...
3
votes
1answer
373 views

Tell Mathematica to factor something specific

Is there a way to tell Mathematica to factor $$ \frac{1}{1-x^2} $$ from a large expression? For instance if the expression is A_1+A_2+A_3 and I want to factor ...
3
votes
2answers
136 views

Factor multiplied matrix with vector

Say I have a matrix multiplication of the form $$B=A\cdot X$$ or $$\left( \begin{array}{c} \text{a11} \text{x1}+\text{a12} \text{x2}+\text{a13} \text{x3} \\ \text{a21} \text{x1}+\text{a22} \text{...
3
votes
1answer
127 views

Factorize and find the null space of a polynomial in several variables [duplicate]

I've been asked to factor the following polynomial: poly = 6 x^3 + x^2 y - 11 xy^2 - 6 y^3 - 5 x^2 z + 11 xyz + 11 y^2 z - 2 xz^2 - 6 yz^2 + z^3 And to solve for z so that poly = 0 Can anyone help ...
3
votes
1answer
93 views

How to efficiently find only the rational roots of a rational complex polynomial?

I need to find all the rational roots of a bunch of high-order polynomials with rational complex coefficients. Is there an efficient way to do this? My best effort on an example polynomial: ...
3
votes
1answer
142 views

Factor fraction, where variable occurring in both, numerator and denominator, only appears once

I have an expression like $$\frac{1+a^2+2 a \cos\left(p\right)}{\left(1+b^2\right)z-1-a^2-2 \left(a+b z\right)\cos\left(p\right)}\text{.}\tag{1}$$ Is there a combination of Mathematica functions to ...
3
votes
0answers
64 views

Explicitly find a guaranteed factorization of large expression?

Consider the large expression LE defined in this file (involving only linearly independent functions), or in this file (linear interdependence present but slightly ...
3
votes
0answers
699 views

Extract common factor from vector or matrix

I can't believe this hasn't been asked before but I can't find anything. Is there a way to convince Simplify or FullSimplify to ...
2
votes
3answers
160 views

Question on alternate forms of polynomial output

EDIT: Would it be possible to do something like let $y=ax+b$ then use Collect[] or Apart[] on the new expression? How would I go about this. I've tried using Collect[%,ax+b], Collect[%,{ax+b}], and ...
2
votes
2answers
107 views

Selecting divisors of a large number that meet some criteria using the factors list

I have a list that represents a factorization of a number: its format is identical to the output of FactorInteger. I need to select the divisors that meet some ...
2
votes
1answer
80 views

How to replace $-x^{}\,y^*-y^{}\,x^*$ by $-(x^{}\,y^*+y^{}\,x^*)$?

Up to now, I have tried some codes like the following: ...
2
votes
1answer
325 views

Factoring out a common term

Very simple question, but I can't find a simple answer here or in the documentation. I have an expression: qq = a x + b x^2 + c x^3 and wish to factor out a ...
2
votes
1answer
161 views

Implementation of Decompose

I'm curious as to how Decompose works so I decided to use Trace with the option ...
2
votes
1answer
155 views

can I expand non-integer powers

How can I help Mma to recognize that w can be factored out of (a w)^a (w - a w)^(1 - a). Assumptions: w>0 and 1>a>0.
2
votes
1answer
334 views

Expressing large numbers in index form

I have a quick question. Is there anyway of expressing a large number as a power of another number in Mathematica? By this, I mean for example, $1237940039285380274899124224 = 512^{10}$. Is there a ...
2
votes
1answer
379 views

Why doesn't FullSimplify work properly on this?

I wish to simplify the simple expression fac[n_] := Sum[R^i, {i, 0, n}]; as much as possible for various $n$. FullSimplify or <...
2
votes
2answers
447 views

Lists of coefficients of derivatives

I want to extract two separate lists of coefficients of derivatives. If I have, for example, ...
2
votes
1answer
105 views

One of the factors greater than $x$

Is there an easy way to tell Mathematica to find one of the prime factors of $n$ greater than $x$. For example, if $n=1299709\cdot 7919 \cdot 17$, is there a way to request a factor greater than $100$....
1
vote
4answers
490 views

How do I create a list of 25 random quadratic equations in the form ax^2+bx+c?

My teacher suggests using the RandomInteger command along with the Factor command, but I cannot figure out the syntax. A, b, and c need to be non zero integers between -10 and 10.
1
vote
5answers
150 views

What's wrong with my implementation of SquareFreeQ?

This was a question I had last month: Part A: Looking at the exponent of each of the elements in the list, FactorInteger and using ...
1
vote
2answers
63 views

Transforming functions

I am not familiar with Mathematica but have the following question: I am trying to write Mathematica code that transforms $x^a+y^a$ to $(x+y)^a$ for any $x$ and $y$ and integer $a$. I also need to ...
1
vote
1answer
97 views

Is Factor reliable to find factorization? [closed]

I have two polynomials given by: ...
1
vote
1answer
75 views

Factor bivariate polynomial over the complex numbers

This is very much like Factoring polynomials to factors involving complex coefficients except that I'm concerned about bivariate polynomials, not univariate polynomials. Take for example the ...
1
vote
2answers
142 views

factorization of integer into two parts with specific prime factors

I would like to write a Mathematica code to decompose an integer into two or more parts with primes in special intervals. For instance, I want to decompose $m=\binom{n}{k}$ into two parts U and V ...
1
vote
1answer
142 views

Collecting terms in an expression [duplicate]

I have an expression: ...
1
vote
2answers
514 views

How can I factor my trigonometric equation?

The equation $$3\sin^2 x - 3\cos x -6\sin x + 2\sin 2x + 3=0$$ has a solution $x = 0$. That means it has a factor of $\cos x - 1$. I tried to write the given equation has the form $$(\cos x - 1)P(...
1
vote
1answer
202 views

Factoring large integers with the Pollard p-1 method

I am trying to use the Pollard $p-1$ method to find the factors of a large integer. Here is the problem: An RSA-type cipher is based on the integer $n = 140016480344628383$ and exponent $2345671$...
1
vote
1answer
312 views

How to represent very long integers with at-most-8-digit(base-10) short integers with * and +

I need an algorithm in Mathematica, which can represent any very long integer, prime or not, into the the product operation "*" and sum "+" forms by short integers (not more than 8 decimal digits). ...
1
vote
1answer
53 views

Timing and ListPlot

I am currently trying to examine the Timing function as it relates to generating primes and factorize large integers. What I want to do is to visualize how time ...
1
vote
1answer
130 views

Factor terms by kets

I have an expression that contains several kets with numerical factors. I would like to retrieve the individual kets and store each individually as a list element. The expression is as follows: <...
1
vote
1answer
152 views

Factorize Parametric Polynomials

Is there a possibility to factorize a parametric polynomial expression - meaning that the coefficients are defined as parameters, and not as specific numbers? My example - a polynomial in ...
1
vote
1answer
46 views

Formatting the prime factorization of expressions

I have a series expansion in $x$ and $a,b$ are constants which I want to type in $\LaTeX$. But the numbers/integers are pretty large (have a lot of digits) so it becomes a bit messy in $\LaTeX$. ...
1
vote
1answer
144 views

How to factorise a variable out of an indefinite sum?

(I should start by saying I'm a total beginner with Mathematica, so if the answer needs code I'll need it spelled out quite clearly, the learning curve for this is proving steep!) Basically what I am ...